mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-23 08:07:07 +00:00
* Headers/fontconfig/FCFaceInfo.h: Add instancevariable _patternIsResolved.
* Source/fontconfig/FCFaceInfo.m (-matchedPattern): Cache the resolved pattern and return this. The method characterSet now uses this cached pattern. Patch by Josh Freeman <gnustep_lists@twilightedge.com>
This commit is contained in:
parent
efe22e8557
commit
e929b48e0b
3 changed files with 29 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
|||
2020-06-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/fontconfig/FCFaceInfo.h: Add instancevariable _patternIsResolved.
|
||||
* Source/fontconfig/FCFaceInfo.m (-matchedPattern): Cache the
|
||||
resolved pattern and return this. The method characterSet now uses
|
||||
this cached pattern.
|
||||
Patch by Josh Freeman <gnustep_lists@twilightedge.com>
|
||||
|
||||
2020-04-25 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* Source/GSBackend.m:
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
NSString *_familyName;
|
||||
NSCharacterSet *_characterSet;
|
||||
BOOL _hasNoCharacterSet;
|
||||
BOOL _patternIsResolved;
|
||||
}
|
||||
|
||||
- (id) initWithfamilyName: (NSString *)familyName
|
||||
|
|
|
@ -133,27 +133,32 @@
|
|||
|
||||
- (FcPattern *) matchedPattern
|
||||
{
|
||||
FcResult result;
|
||||
FcPattern *resolved;
|
||||
|
||||
FcConfigSubstitute(NULL, _pattern, FcMatchPattern);
|
||||
FcDefaultSubstitute(_pattern);
|
||||
resolved = FcFontMatch(NULL, _pattern, &result);
|
||||
|
||||
return resolved;
|
||||
}
|
||||
|
||||
- (NSCharacterSet*)characterSet
|
||||
{
|
||||
if (_characterSet == nil && !_hasNoCharacterSet)
|
||||
if (!_patternIsResolved)
|
||||
{
|
||||
FcResult result;
|
||||
FcPattern *resolved;
|
||||
FcCharSet *charset;
|
||||
|
||||
|
||||
FcConfigSubstitute(NULL, _pattern, FcMatchPattern);
|
||||
FcDefaultSubstitute(_pattern);
|
||||
resolved = FcFontMatch(NULL, _pattern, &result);
|
||||
FcPatternDestroy(_pattern);
|
||||
_pattern = resolved;
|
||||
_patternIsResolved = YES;
|
||||
}
|
||||
|
||||
// The caller expects ownership of returned pattern and will destroy it
|
||||
FcPatternReference(_pattern);
|
||||
return _pattern;
|
||||
}
|
||||
|
||||
- (NSCharacterSet*) characterSet
|
||||
{
|
||||
if (_characterSet == nil && !_hasNoCharacterSet)
|
||||
{
|
||||
FcPattern *resolved;
|
||||
FcCharSet *charset;
|
||||
|
||||
resolved = [self matchedPattern];
|
||||
|
||||
if (FcResultMatch == FcPatternGetCharSet(resolved, FC_CHARSET, 0, &charset))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue