Migrated aat.m back.
This commit is contained in:
parent
36567cc522
commit
d8ad3300c9
|
@ -10,17 +10,3 @@ extern void initUnderlineColors(void);
|
||||||
extern void uninitUnderlineColors(void);
|
extern void uninitUnderlineColors(void);
|
||||||
typedef void (^backgroundBlock)(uiDrawContext *c, uiDrawTextLayout *layout, double x, double y);
|
typedef void (^backgroundBlock)(uiDrawContext *c, uiDrawTextLayout *layout, double x, double y);
|
||||||
extern CFAttributedStringRef attrstrToCoreFoundation(uiDrawTextLayoutParams *p, NSArray **backgroundBlocks);
|
extern CFAttributedStringRef attrstrToCoreFoundation(uiDrawTextLayoutParams *p, NSArray **backgroundBlocks);
|
||||||
|
|
||||||
// aat.m
|
|
||||||
typedef void (^aatBlock)(uint16_t type, uint16_t selector);
|
|
||||||
extern void openTypeToAAT(char a, char b, char c, char d, uint32_t value, aatBlock f);
|
|
||||||
|
|
||||||
// opentype.m
|
|
||||||
// TODO this is only used by opentype.m and aat.m; figure out some better way to handle this
|
|
||||||
// TODO remove x8tox32()
|
|
||||||
#define x8tox32(x) ((uint32_t) (((uint8_t) (x)) & 0xFF))
|
|
||||||
#define mkTag(a, b, c, d) \
|
|
||||||
((x8tox32(a) << 24) | \
|
|
||||||
(x8tox32(b) << 16) | \
|
|
||||||
(x8tox32(c) << 8) | \
|
|
||||||
x8tox32(d))
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// 14 february 2017
|
// 14 february 2017
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
|
#import "attrstr.h"
|
||||||
|
|
||||||
// TODO explain the purpose of this file
|
// TODO explain the purpose of this file
|
||||||
|
|
||||||
static void boolspec(uint32_t value, uint16_t type, uint16_t ifTrue, uint16_t ifFalse, aatBlock f)
|
static void boolspec(uint32_t value, uint16_t type, uint16_t ifTrue, uint16_t ifFalse, uiprivAATBlock f)
|
||||||
{
|
{
|
||||||
// TODO are values other than 1 accepted for true by OpenType itself? (same for the rest of the file)
|
// TODO are values other than 1 accepted for true by OpenType itself? (same for the rest of the file)
|
||||||
if (value != 0) {
|
if (value != 0) {
|
||||||
|
@ -13,8 +14,17 @@ static void boolspec(uint32_t value, uint16_t type, uint16_t ifTrue, uint16_t if
|
||||||
f(type, ifFalse);
|
f(type, ifFalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO remove the need for this
|
||||||
|
// TODO remove x8tox32()
|
||||||
|
#define x8tox32(x) ((uint32_t) (((uint8_t) (x)) & 0xFF))
|
||||||
|
#define mkTag(a, b, c, d) \
|
||||||
|
((x8tox32(a) << 24) | \
|
||||||
|
(x8tox32(b) << 16) | \
|
||||||
|
(x8tox32(c) << 8) | \
|
||||||
|
x8tox32(d))
|
||||||
|
|
||||||
// TODO double-check drawtext example to make sure all of these are used properly (I already screwed dlig up by putting clig twice instead)
|
// TODO double-check drawtext example to make sure all of these are used properly (I already screwed dlig up by putting clig twice instead)
|
||||||
void openTypeToAAT(char a, char b, char c, char d, uint32_t value, aatBlock f)
|
void uiprivOpenTypeToAAT(char a, char b, char c, char d, uint32_t value, uiprivAATBlock f)
|
||||||
{
|
{
|
||||||
switch (mkTag(a, b, c, d)) {
|
switch (mkTag(a, b, c, d)) {
|
||||||
case mkTag('l', 'i', 'g', 'a'):
|
case mkTag('l', 'i', 'g', 'a'):
|
|
@ -3,3 +3,7 @@
|
||||||
|
|
||||||
// opentype.m
|
// opentype.m
|
||||||
extern CFArrayRef uiprivOpenTypeFeaturesToCTFeatures(const uiOpenTypeFeatures *otf);
|
extern CFArrayRef uiprivOpenTypeFeaturesToCTFeatures(const uiOpenTypeFeatures *otf);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
|
@ -53,7 +53,7 @@ static uiForEach otfArrayForEachAAT(const uiOpenTypeFeatures *otf, char a, char
|
||||||
|
|
||||||
p.array = (CFMutableArrayRef) data;
|
p.array = (CFMutableArrayRef) data;
|
||||||
p.tagIsNumber = YES;
|
p.tagIsNumber = YES;
|
||||||
openTypeToAAT(a, b, c, d, value, ^(uint16_t type, uint16_t selector) {
|
uiprivOpenTypeToAAT(a, b, c, d, value, ^(uint16_t type, uint16_t selector) {
|
||||||
p.tagKey = kCTFontFeatureTypeIdentifierKey;
|
p.tagKey = kCTFontFeatureTypeIdentifierKey;
|
||||||
p.tagType = kCFNumberSInt16Type;
|
p.tagType = kCFNumberSInt16Type;
|
||||||
p.tagValue = (const SInt16 *) (&type);
|
p.tagValue = (const SInt16 *) (&type);
|
||||||
|
|
Loading…
Reference in New Issue