2018-03-04 14:09:27 -06:00
|
|
|
// 4 march 2018
|
2018-03-04 14:48:45 -06:00
|
|
|
#import "../common/attrstr.h"
|
2018-03-04 14:09:27 -06:00
|
|
|
|
|
|
|
// opentype.m
|
|
|
|
extern CFArrayRef uiprivOpenTypeFeaturesToCTFeatures(const uiOpenTypeFeatures *otf);
|
2018-03-04 14:53:46 -06:00
|
|
|
|
|
|
|
// aat.m
|
|
|
|
typedef void (^uiprivAATBlock)(uint16_t type, uint16_t selector);
|
|
|
|
extern void uiprivOpenTypeToAAT(char a, char b, char c, char d, uint32_t value, uiprivAATBlock f);
|
2018-03-04 17:01:08 -06:00
|
|
|
|
|
|
|
// fontmatch.m
|
|
|
|
@interface uiprivFontStyleData : NSObject {
|
|
|
|
CTFontRef font;
|
|
|
|
CTFontDescriptorRef desc;
|
|
|
|
CFDictionaryRef traits;
|
|
|
|
CTFontSymbolicTraits symbolic;
|
|
|
|
double weight;
|
|
|
|
double width;
|
|
|
|
BOOL didStyleName;
|
|
|
|
CFStringRef styleName;
|
|
|
|
BOOL didVariation;
|
|
|
|
CFDictionaryRef variation;
|
|
|
|
BOOL hasRegistrationScope;
|
|
|
|
CTFontManagerScope registrationScope;
|
|
|
|
BOOL didPostScriptName;
|
|
|
|
CFStringRef postScriptName;
|
|
|
|
CTFontFormat fontFormat;
|
|
|
|
BOOL didPreferredSubFamilyName;
|
|
|
|
CFStringRef preferredSubFamilyName;
|
|
|
|
BOOL didSubFamilyName;
|
|
|
|
CFStringRef subFamilyName;
|
|
|
|
BOOL didFullName;
|
|
|
|
CFStringRef fullName;
|
|
|
|
BOOL didPreferredFamilyName;
|
|
|
|
CFStringRef preferredFamilyName;
|
|
|
|
BOOL didFamilyName;
|
|
|
|
CFStringRef familyName;
|
|
|
|
BOOL didVariationAxes;
|
|
|
|
CFArrayRef variationAxes;
|
|
|
|
}
|
|
|
|
- (id)initWithFont:(CTFontRef)f;
|
|
|
|
- (id)initWithDescriptor:(CTFontDescriptorRef)d;
|
|
|
|
- (BOOL)prepare;
|
|
|
|
- (void)ensureFont;
|
|
|
|
- (CTFontSymbolicTraits)symbolicTraits;
|
|
|
|
- (double)weight;
|
|
|
|
- (double)width;
|
|
|
|
- (CFStringRef)styleName;
|
|
|
|
- (CFDictionaryRef)variation;
|
|
|
|
- (BOOL)hasRegistrationScope;
|
|
|
|
- (CTFontManagerScope)registrationScope;
|
|
|
|
- (CFStringRef)postScriptName;
|
|
|
|
- (CFDataRef)table:(CTFontTableTag)tag;
|
|
|
|
- (CTFontFormat)fontFormat;
|
|
|
|
- (CFStringRef)fontName:(CFStringRef)key;
|
|
|
|
- (CFStringRef)preferredSubFamilyName;
|
|
|
|
- (CFStringRef)subFamilyName;
|
|
|
|
- (CFStringRef)fullName;
|
|
|
|
- (CFStringRef)preferredFamilyName;
|
|
|
|
- (CFStringRef)familyName;
|
|
|
|
- (CFArrayRef)variationAxes;
|
|
|
|
@end
|
2018-03-08 22:04:45 -06:00
|
|
|
extern CTFontDescriptorRef uiprivFontDescriptorToCTFontDescriptor(uiFontDescriptor *fd);
|
2018-03-04 17:01:08 -06:00
|
|
|
extern CTFontDescriptorRef uiprivCTFontDescriptorAppendFeatures(CTFontDescriptorRef desc, const uiOpenTypeFeatures *otf);
|
2018-03-08 22:04:45 -06:00
|
|
|
extern void uiprivFontDescriptorFromCTFontDescriptor(CTFontDescriptorRef ctdesc, uiFontDescriptor *uidesc);
|
2018-03-04 17:01:08 -06:00
|
|
|
|
|
|
|
// fonttraits.m
|
2018-03-08 22:04:45 -06:00
|
|
|
extern void uiprivProcessFontTraits(uiprivFontStyleData *d, uiFontDescriptor *out);
|
2018-03-04 17:01:08 -06:00
|
|
|
|
|
|
|
// fontvariation.m
|
|
|
|
extern NSDictionary *uiprivMakeVariationAxisDict(CFArrayRef axes, CFDataRef avarTable);
|
2018-03-08 22:04:45 -06:00
|
|
|
extern void uiprivProcessFontVariation(uiprivFontStyleData *d, NSDictionary *axisDict, uiFontDescriptor *out);
|
2018-03-04 19:01:52 -06:00
|
|
|
|
|
|
|
// attrstr.m
|
|
|
|
extern void uiprivInitUnderlineColors(void);
|
|
|
|
extern void uiprivUninitUnderlineColors(void);
|
2018-03-11 01:26:32 -06:00
|
|
|
extern CFAttributedStringRef uiprivAttributedStringToCFAttributedString(uiDrawTextLayoutParams *p, NSArray **backgroundParams);
|
|
|
|
|
|
|
|
// drawtext.m
|
|
|
|
@interface uiprivDrawTextBackgroundParams : NSObject {
|
|
|
|
size_t start;
|
|
|
|
size_t end;
|
|
|
|
double r;
|
|
|
|
double g;
|
|
|
|
double b;
|
|
|
|
double a;
|
|
|
|
}
|
|
|
|
- (id)initWithStart:(size_t)s end:(size_t)e r:(double)red g:(double)green b:(double)blue a:(double)alpha;
|
|
|
|
- (void)draw:(CGContextRef)c layout:(uiDrawTextLayout *)layout at:(double)x y:(double)y utf8Mapping:(const size_t *)u16tou8;
|
|
|
|
@end
|