Converted darwin/aat.m to the new OpenType system. We can't use the code as-is just yet, though.
This commit is contained in:
parent
72f5b680f2
commit
1a2dd1f16b
583
darwin/aat.m
583
darwin/aat.m
|
@ -1,388 +1,397 @@
|
||||||
// 14 february 2017
|
// 14 february 2017
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
|
|
||||||
static void boolspec(uiAttributeSpec *spec, uint16_t type, uint16_t ifTrue, uint16_t ifFalse, specToAATEnumFunc f, void *data)
|
struct openTypeAATParams {
|
||||||
|
void (*doAAT)(uint16_t type, uint16_t selector, void *data);
|
||||||
|
void *data;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define pcall(p, type, selector) ((*(p->doAAT))(type, selector, p->data))
|
||||||
|
|
||||||
|
static void boolspec(uint32_t value, uint16_t type, uint16_t ifTrue, uint16_t ifFalse, struct openTypeAATParams *p)
|
||||||
{
|
{
|
||||||
if (spec->Value != 0) {
|
// TODO are values other than 1 accepted for true by OpenType itself? (same for the rest of the file)
|
||||||
(*f)(type, ifTrue, data);
|
if (value != 0) {
|
||||||
|
pcall(p, type, ifTrue);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
(*f)(type, ifFalse, data);
|
pcall(p, type, ifFalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
int specToAAT(uiAttributeSpec *spec, specToAATEnumFunc f, void *data)
|
void openTypeToAAT(char a, char b, char c, char d, uint32_t value, void *data)
|
||||||
{
|
{
|
||||||
switch (spec->Type) {
|
struct openTypeAATParams *p = (struct openTypeAATParams *) data;
|
||||||
case uiAttributeStandardLigatures:
|
|
||||||
boolspec(spec, kLigaturesType,
|
switch (mkTag(a, b, c, d)) {
|
||||||
|
case mkTag('l', 'i', 'g', 'a'):
|
||||||
|
boolspec(value, kLigaturesType,
|
||||||
kCommonLigaturesOnSelector,
|
kCommonLigaturesOnSelector,
|
||||||
kCommonLigaturesOffSelector,
|
kCommonLigaturesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeRequiredLigatures:
|
case mkTag('r', 'l', 'i', 'g'):
|
||||||
boolspec(spec, kLigaturesType,
|
boolspec(value, kLigaturesType,
|
||||||
kRequiredLigaturesOnSelector,
|
kRequiredLigaturesOnSelector,
|
||||||
kRequiredLigaturesOffSelector,
|
kRequiredLigaturesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeDiscretionaryLigatures:
|
case mkTag('d', 'l', 'i', 'g'):
|
||||||
boolspec(spec, kLigaturesType,
|
boolspec(value, kLigaturesType,
|
||||||
kRareLigaturesOnSelector,
|
kRareLigaturesOnSelector,
|
||||||
kRareLigaturesOffSelector,
|
kRareLigaturesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeContextualLigatures:
|
case mkTag('c', 'l', 'i', 'g'):
|
||||||
boolspec(spec, kLigaturesType,
|
boolspec(value, kLigaturesType,
|
||||||
kContextualLigaturesOnSelector,
|
kContextualLigaturesOnSelector,
|
||||||
kContextualLigaturesOffSelector,
|
kContextualLigaturesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeHistoricalLigatures:
|
case mkTag('h', 'l', 'i', 'g'):
|
||||||
boolspec(spec, kLigaturesType,
|
// This technically isn't what is meant by "historical ligatures", but Core Text's internal AAT-to-OpenType mapping says to include it, so we include it too
|
||||||
|
case mkTag('h', 'i', 's', 't'):
|
||||||
|
boolspec(value, kLigaturesType,
|
||||||
kHistoricalLigaturesOnSelector,
|
kHistoricalLigaturesOnSelector,
|
||||||
kHistoricalLigaturesOffSelector,
|
kHistoricalLigaturesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeUnicase:
|
case mkTag('u', 'n', 'i', 'c'):
|
||||||
// TODO is this correct, or should we provide an else case?
|
// TODO is this correct, or should we provide an else case?
|
||||||
if (spec->Value != 0)
|
if (value != 0)
|
||||||
// this is undocumented; it comes from Core Text's internal AAT-to-OpenType conversion table
|
// this is undocumented; it comes from Core Text's internal AAT-to-OpenType conversion table
|
||||||
(*f)(kLetterCaseType, 14, data);
|
pcall(p, kLetterCaseType, 14);
|
||||||
return 1;
|
break;
|
||||||
// TODO make an array?
|
|
||||||
case uiAttributeNumberSpacings:
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
switch (spec->Value) {
|
case mkTag('p', 'n', 'u', 'm'):
|
||||||
case uiAttributeNumberSpacingProportional:
|
if (value != 0)
|
||||||
(*f)(kNumberSpacingType, kProportionalNumbersSelector, data);
|
pcall(p, kNumberSpacingType, kProportionalNumbersSelector);
|
||||||
break;
|
break;
|
||||||
case uiAttributeNumberSpacingTabular:
|
case mkTag('t', 'n', 'u', 'm'):
|
||||||
(*f)(kNumberSpacingType, kMonospacedNumbersSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kNumberSpacingType, kMonospacedNumbersSelector);
|
||||||
}
|
break;
|
||||||
return 1;
|
|
||||||
// TODO make an array?
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
case uiAttributeSuperscripts:
|
case mkTag('s', 'u', 'p', 's'):
|
||||||
switch (spec->Value) {
|
if (value != 0)
|
||||||
case uiAttributeSuperscriptNone:
|
pcall(p, kVerticalPositionType, kSuperiorsSelector);
|
||||||
(*f)(kVerticalPositionType, kNormalPositionSelector, data);
|
break;
|
||||||
break;
|
case mkTag('s', 'u', 'b', 's'):
|
||||||
case uiAttributeSuperscriptSuperscript:
|
if (value != 0)
|
||||||
(*f)(kVerticalPositionType, kSuperiorsSelector, data);
|
pcall(p, kVerticalPositionType, kInferiorsSelector);
|
||||||
break;
|
break;
|
||||||
case uiAttributeSuperscriptSubscript:
|
case mkTag('o', 'r', 'd', 'n'):
|
||||||
(*f)(kVerticalPositionType, kInferiorsSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kVerticalPositionType, kOrdinalsSelector);
|
||||||
case uiAttributeSuperscriptOrdinal:
|
break;
|
||||||
(*f)(kVerticalPositionType, kOrdinalsSelector, data);
|
case mkTag('s', 'i', 'n', 'f'):
|
||||||
break;
|
if (value != 0)
|
||||||
case uiAttributeSuperscriptScientificInferior:
|
pcall(p, kVerticalPositionType, kScientificInferiorsSelector);
|
||||||
(*f)(kVerticalPositionType, kScientificInferiorsSelector, data);
|
break;
|
||||||
break;
|
|
||||||
}
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
return 1;
|
case mkTag('a', 'f', 'r', 'c'):
|
||||||
// TODO make an array?
|
if (value != 0)
|
||||||
case uiAttributeFractionForms:
|
pcall(p, kFractionsType, kVerticalFractionsSelector);
|
||||||
switch (spec->Value) {
|
break;
|
||||||
case uiAttributeFractionFormNone:
|
case mkTag('f', 'r', 'a', 'c'):
|
||||||
(*f)(kFractionsType, kNoFractionsSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kFractionsType, kDiagonalFractionsSelector);
|
||||||
case uiAttributeFractionFormVertical:
|
break;
|
||||||
(*f)(kFractionsType, kVerticalFractionsSelector, data);
|
|
||||||
break;
|
case mkTag('z', 'e', 'r', 'o'):
|
||||||
case uiAttributeFractionFormDiagonal:
|
boolspec(value, kTypographicExtrasType,
|
||||||
(*f)(kFractionsType, kDiagonalFractionsSelector, data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
case uiAttributeSlashedZero:
|
|
||||||
boolspec(spec, kTypographicExtrasType,
|
|
||||||
kSlashedZeroOnSelector,
|
kSlashedZeroOnSelector,
|
||||||
kSlashedZeroOffSelector,
|
kSlashedZeroOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeMathematicalGreek:
|
case mkTag('m', 'g', 'r', 'k'):
|
||||||
boolspec(spec, kMathematicalExtrasType,
|
boolspec(value, kMathematicalExtrasType,
|
||||||
kMathematicalGreekOnSelector,
|
kMathematicalGreekOnSelector,
|
||||||
kMathematicalGreekOffSelector,
|
kMathematicalGreekOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeOrnamentalForms:
|
case mkTag('o', 'r', 'n', 'm'):
|
||||||
(*f)(kOrnamentSetsType, (uint16_t) (spec->Value), data);
|
pcall(p, kOrnamentSetsType, (uint16_t) value);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeSpecificCharacterForm:
|
case mkTag('a', 'a', 'l', 't'):
|
||||||
(*f)(kCharacterAlternativesType, (uint16_t) (spec->Value), data);
|
pcall(p, kCharacterAlternativesType, (uint16_t) value);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeTitlingCapitalForms:
|
case mkTag('t', 'i', 't', 'l'):
|
||||||
// TODO is this correct, or should we provide an else case?
|
// TODO is this correct, or should we provide an else case?
|
||||||
if (spec->Value != 0)
|
if (spec->Value != 0)
|
||||||
(*f)(kStyleOptionsType, kTitlingCapsSelector, data);
|
pcall(p, kStyleOptionsType, kTitlingCapsSelector);
|
||||||
return 1;
|
break;
|
||||||
// TODO make an array?
|
|
||||||
case uiAttributeHanCharacterForms:
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
switch (spec->Value) {
|
case mkTag('t', 'r', 'a', 'd'):
|
||||||
case uiAttributeHanCharacterFormTraditional:
|
if (value != 0)
|
||||||
(*f)(kCharacterShapeType, kTraditionalCharactersSelector, data);
|
pcall(p, kCharacterShapeType, kTraditionalCharactersSelector);
|
||||||
break;
|
break;
|
||||||
case uiAttributeHanCharacterFormSimplified:
|
case mkTag('s', 'm', 'p', 'l'):
|
||||||
(*f)(kCharacterShapeType, kSimplifiedCharactersSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kCharacterShapeType, kSimplifiedCharactersSelector);
|
||||||
case uiAttributeHanCharacterFormJIS1978:
|
break;
|
||||||
(*f)(kCharacterShapeType, kJIS1978CharactersSelector, data);
|
case mkTag('j', 'p', '7', '8'):
|
||||||
break;
|
if (value != 0)
|
||||||
case uiAttributeHanCharacterFormJIS1983:
|
pcall(p, kCharacterShapeType, kJIS1978CharactersSelector);
|
||||||
(*f)(kCharacterShapeType, kJIS1983CharactersSelector, data);
|
break;
|
||||||
break;
|
case mkTag('j', 'p', '8', '3'):
|
||||||
case uiAttributeHanCharacterFormJIS1990:
|
if (value != 0)
|
||||||
(*f)(kCharacterShapeType, kJIS1990CharactersSelector, data);
|
pcall(p, kCharacterShapeType, kJIS1983CharactersSelector);
|
||||||
break;
|
break;
|
||||||
case uiAttributeHanCharacterFormExpert:
|
case mkTag('j', 'p', '9', '0'):
|
||||||
(*f)(kCharacterShapeType, kExpertCharactersSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kCharacterShapeType, kJIS1990CharactersSelector);
|
||||||
case uiAttributeHanCharacterFormJIS2004:
|
break;
|
||||||
(*f)(kCharacterShapeType, kJIS2004CharactersSelector, data);
|
case mkTag('e', 'x', 'p', 't'):
|
||||||
break;
|
if (value != 0)
|
||||||
case uiAttributeHanCharacterFormHojo:
|
pcall(p, kCharacterShapeType, kExpertCharactersSelector);
|
||||||
(*f)(kCharacterShapeType, kHojoCharactersSelector, data);
|
break;
|
||||||
break;
|
case mkTag('j', 'p', '0', '4'):
|
||||||
case uiAttributeHanCharacterFormNLC:
|
if (value != 0)
|
||||||
(*f)(kCharacterShapeType, kNLCCharactersSelector, data);
|
pcall(p, kCharacterShapeType, kJIS2004CharactersSelector);
|
||||||
break;
|
break;
|
||||||
case uiAttributeHanCharacterFormTraditionalNames:
|
case mkTag('h', 'o', 'j', 'o'):
|
||||||
(*f)(kCharacterShapeType, kTraditionalNamesCharactersSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kCharacterShapeType, kHojoCharactersSelector);
|
||||||
}
|
break;
|
||||||
return 1;
|
case mkTag('n', 'l', 'c', 'k'):
|
||||||
case uiAttributeLowercaseNumbers:
|
if (value != 0)
|
||||||
|
pcall(p, kCharacterShapeType, kNLCCharactersSelector);
|
||||||
|
break;
|
||||||
|
case mkTag('t', 'n', 'a', 'm'):
|
||||||
|
if (value != 0)
|
||||||
|
pcall(p, kCharacterShapeType, kTraditionalNamesCharactersSelector);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case mkTag('o', 'n', 'u', 'm'):
|
||||||
|
// Core Text's internal AAT-to-OpenType mapping says to include this, so we include it too
|
||||||
|
// TODO is it always set?
|
||||||
|
case mkTag('l', 'n', 'u', 'm'):
|
||||||
// TODO is this correct, or should we provide an else case?
|
// TODO is this correct, or should we provide an else case?
|
||||||
if (spec->Value != 0)
|
if (value != 0)
|
||||||
(*f)(kNumberCaseType, kLowerCaseNumbersSelector, data);
|
pcall(p, kNumberCaseType, kLowerCaseNumbersSelector);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeHanjaToHangul:
|
case mkTag('h', 'n', 'g', 'l'):
|
||||||
// TODO is this correct, or should we provide an else case?
|
// TODO is this correct, or should we provide an else case?
|
||||||
if (spec->Value != 0)
|
if (value != 0)
|
||||||
(*f)(kTransliterationType, kHanjaToHangulSelector, data);
|
pcall(p, kTransliterationType, kHanjaToHangulSelector);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeAnnotatedGlyphForms:
|
case mkTag('n', 'a', 'l', 't'):
|
||||||
(*f)(kAnnotationType, (uint16_t) (spec->Value), data);
|
pcall(p, kAnnotationType, (uint16_t) value);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeRubyKanaForms:
|
case mkTag('r', 'u', 'b', 'y'):
|
||||||
// include this for completeness
|
// include this for completeness
|
||||||
boolspec(spec, kRubyKanaType,
|
boolspec(value, kRubyKanaType,
|
||||||
kRubyKanaSelector,
|
kRubyKanaSelector,
|
||||||
kNoRubyKanaSelector,
|
kNoRubyKanaSelector,
|
||||||
f, data);
|
p);
|
||||||
// this is the current one
|
// this is the current one
|
||||||
boolspec(spec, kRubyKanaType,
|
boolspec(value, kRubyKanaType,
|
||||||
kRubyKanaOnSelector,
|
kRubyKanaOnSelector,
|
||||||
kRubyKanaOffSelector,
|
kRubyKanaOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeCJKRomansToItalics:
|
case mkTag('i', 't', 'a', 'l'):
|
||||||
// include this for completeness
|
// include this for completeness
|
||||||
boolspec(spec, kItalicCJKRomanType,
|
boolspec(value, kItalicCJKRomanType,
|
||||||
kCJKItalicRomanSelector,
|
kCJKItalicRomanSelector,
|
||||||
kNoCJKItalicRomanSelector,
|
kNoCJKItalicRomanSelector,
|
||||||
f, data);
|
p);
|
||||||
// this is the current one
|
// this is the current one
|
||||||
boolspec(spec, kItalicCJKRomanType,
|
boolspec(value, kItalicCJKRomanType,
|
||||||
kCJKItalicRomanOnSelector,
|
kCJKItalicRomanOnSelector,
|
||||||
kCJKItalicRomanOffSelector,
|
kCJKItalicRomanOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeCaseSensitiveForms:
|
case mkTag('c', 'a', 's', 'e'):
|
||||||
boolspec(spec, kCaseSensitiveLayoutType,
|
boolspec(value, kCaseSensitiveLayoutType,
|
||||||
kCaseSensitiveLayoutOnSelector,
|
kCaseSensitiveLayoutOnSelector,
|
||||||
kCaseSensitiveLayoutOffSelector,
|
kCaseSensitiveLayoutOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeCapitalSpacing:
|
case mkTag('c', 'p', 's', 'p'):
|
||||||
boolspec(spec, kCaseSensitiveLayoutType,
|
boolspec(value, kCaseSensitiveLayoutType,
|
||||||
kCaseSensitiveSpacingOnSelector,
|
kCaseSensitiveSpacingOnSelector,
|
||||||
kCaseSensitiveSpacingOffSelector,
|
kCaseSensitiveSpacingOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeAlternateHorizontalKana:
|
case mkTag('h', 'k', 'n', 'a'):
|
||||||
boolspec(spec, kAlternateKanaType,
|
boolspec(value, kAlternateKanaType,
|
||||||
kAlternateHorizKanaOnSelector,
|
kAlternateHorizKanaOnSelector,
|
||||||
kAlternateHorizKanaOffSelector,
|
kAlternateHorizKanaOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeAlternateVerticalKana:
|
case mkTag('v', 'k', 'n', 'a'):
|
||||||
boolspec(spec, kAlternateKanaType,
|
boolspec(value, kAlternateKanaType,
|
||||||
kAlternateVertKanaOnSelector,
|
kAlternateVertKanaOnSelector,
|
||||||
kAlternateVertKanaOffSelector,
|
kAlternateVertKanaOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate1:
|
case mkTag('s', 's', '0', '1'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltOneOnSelector,
|
kStylisticAltOneOnSelector,
|
||||||
kStylisticAltOneOffSelector,
|
kStylisticAltOneOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate2:
|
case mkTag('s', 's', '0', '2'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltTwoOnSelector,
|
kStylisticAltTwoOnSelector,
|
||||||
kStylisticAltTwoOffSelector,
|
kStylisticAltTwoOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate3:
|
case mkTag('s', 's', '0', '3'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltThreeOnSelector,
|
kStylisticAltThreeOnSelector,
|
||||||
kStylisticAltThreeOffSelector,
|
kStylisticAltThreeOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate4:
|
case mkTag('s', 's', '0', '4'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltFourOnSelector,
|
kStylisticAltFourOnSelector,
|
||||||
kStylisticAltFourOffSelector,
|
kStylisticAltFourOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate5:
|
case mkTag('s', 's', '0', '5'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltFiveOnSelector,
|
kStylisticAltFiveOnSelector,
|
||||||
kStylisticAltFiveOffSelector,
|
kStylisticAltFiveOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate6:
|
case mkTag('s', 's', '0', '6'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltSixOnSelector,
|
kStylisticAltSixOnSelector,
|
||||||
kStylisticAltSixOffSelector,
|
kStylisticAltSixOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate7:
|
case mkTag('s', 's', '0', '7'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltSevenOnSelector,
|
kStylisticAltSevenOnSelector,
|
||||||
kStylisticAltSevenOffSelector,
|
kStylisticAltSevenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate8:
|
case mkTag('s', 's', '0', '8'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltEightOnSelector,
|
kStylisticAltEightOnSelector,
|
||||||
kStylisticAltEightOffSelector,
|
kStylisticAltEightOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate9:
|
case mkTag('s', 's', '0', '9'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltNineOnSelector,
|
kStylisticAltNineOnSelector,
|
||||||
kStylisticAltNineOffSelector,
|
kStylisticAltNineOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate10:
|
case mkTag('s', 's', '1', '0'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltTenOnSelector,
|
kStylisticAltTenOnSelector,
|
||||||
kStylisticAltTenOffSelector,
|
kStylisticAltTenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate11:
|
case mkTag('s', 's', '1', '1'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltElevenOnSelector,
|
kStylisticAltElevenOnSelector,
|
||||||
kStylisticAltElevenOffSelector,
|
kStylisticAltElevenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate12:
|
case mkTag('s', 's', '1', '2'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltTwelveOnSelector,
|
kStylisticAltTwelveOnSelector,
|
||||||
kStylisticAltTwelveOffSelector,
|
kStylisticAltTwelveOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate13:
|
case mkTag('s', 's', '1', '3'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltThirteenOnSelector,
|
kStylisticAltThirteenOnSelector,
|
||||||
kStylisticAltThirteenOffSelector,
|
kStylisticAltThirteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate14:
|
case mkTag('s', 's', '1', '4'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltFourteenOnSelector,
|
kStylisticAltFourteenOnSelector,
|
||||||
kStylisticAltFourteenOffSelector,
|
kStylisticAltFourteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate15:
|
case mkTag('s', 's', '1', '5'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltFifteenOnSelector,
|
kStylisticAltFifteenOnSelector,
|
||||||
kStylisticAltFifteenOffSelector,
|
kStylisticAltFifteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate16:
|
case mkTag('s', 's', '1', '6'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltSixteenOnSelector,
|
kStylisticAltSixteenOnSelector,
|
||||||
kStylisticAltSixteenOffSelector,
|
kStylisticAltSixteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate17:
|
case mkTag('s', 's', '1', '7'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltSeventeenOnSelector,
|
kStylisticAltSeventeenOnSelector,
|
||||||
kStylisticAltSeventeenOffSelector,
|
kStylisticAltSeventeenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate18:
|
case mkTag('s', 's', '1', '8'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltEighteenOnSelector,
|
kStylisticAltEighteenOnSelector,
|
||||||
kStylisticAltEighteenOffSelector,
|
kStylisticAltEighteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate19:
|
case mkTag('s', 's', '1', '9'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltNineteenOnSelector,
|
kStylisticAltNineteenOnSelector,
|
||||||
kStylisticAltNineteenOffSelector,
|
kStylisticAltNineteenOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeStylisticAlternate20:
|
case mkTag('s', 's', '2', '0'):
|
||||||
boolspec(spec, kStylisticAlternativesType,
|
boolspec(value, kStylisticAlternativesType,
|
||||||
kStylisticAltTwentyOnSelector,
|
kStylisticAltTwentyOnSelector,
|
||||||
kStylisticAltTwentyOffSelector,
|
kStylisticAltTwentyOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeContextualAlternates:
|
case mkTag('c', 'a', 'l', 't'):
|
||||||
boolspec(spec, kContextualAlternatesType,
|
boolspec(value, kContextualAlternatesType,
|
||||||
kContextualAlternatesOnSelector,
|
kContextualAlternatesOnSelector,
|
||||||
kContextualAlternatesOffSelector,
|
kContextualAlternatesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeSwashes:
|
case mkTag('s', 'w', 's', 'h'):
|
||||||
boolspec(spec, kContextualAlternatesType,
|
boolspec(value, kContextualAlternatesType,
|
||||||
kSwashAlternatesOnSelector,
|
kSwashAlternatesOnSelector,
|
||||||
kSwashAlternatesOffSelector,
|
kSwashAlternatesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
case uiAttributeContextualSwashes:
|
case mkTag('c', 's', 'w', 'h'):
|
||||||
boolspec(spec, kContextualAlternatesType,
|
boolspec(value, kContextualAlternatesType,
|
||||||
kContextualSwashAlternatesOnSelector,
|
kContextualSwashAlternatesOnSelector,
|
||||||
kContextualSwashAlternatesOffSelector,
|
kContextualSwashAlternatesOffSelector,
|
||||||
f, data);
|
p);
|
||||||
return 1;
|
break;
|
||||||
// TODO use arrays?
|
|
||||||
case uiAttributeLowercaseCapForms:
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
switch (spec->Value) {
|
case mkTag('s', 'm', 'c', 'p'):
|
||||||
case uiAttributeCapFormNormal:
|
if (value != 0) {
|
||||||
(*f)(kLowerCaseType, kDefaultLowerCaseSelector, data);
|
|
||||||
break;
|
|
||||||
case uiAttributeCapFormSmallCaps:
|
|
||||||
// include this for compatibility (some fonts that come with OS X still use this!)
|
// include this for compatibility (some fonts that come with OS X still use this!)
|
||||||
// TODO make it boolean?
|
// TODO make it boolean?
|
||||||
(*f)(kLetterCaseType, kSmallCapsSelector, data);
|
pcall(p, kLetterCaseType, kSmallCapsSelector);
|
||||||
// this is the current one
|
// this is the current one
|
||||||
(*f)(kLowerCaseType, kLowerCaseSmallCapsSelector, data);
|
pcall(p, kLowerCaseType, kLowerCaseSmallCapsSelector);
|
||||||
break;
|
|
||||||
case uiAttributeCapFormPetiteCaps:
|
|
||||||
(*f)(kLowerCaseType, kLowerCasePetiteCapsSelector, data);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return 1;
|
break;
|
||||||
// TODO use arrays?
|
case mkTag('p', 'c', 'a', 'p'):
|
||||||
case uiAttributeUppercaseCapForms:
|
if (value != 0)
|
||||||
switch (spec->Value) {
|
pcall(p, kLowerCaseType, kLowerCasePetiteCapsSelector);
|
||||||
case uiAttributeCapFormNormal:
|
break;
|
||||||
(*f)(kUpperCaseType, kDefaultUpperCaseSelector, data);
|
|
||||||
break;
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
||||||
case uiAttributeCapFormSmallCaps:
|
case mkTag('c', '2', 's', 'c'):
|
||||||
(*f)(kUpperCaseType, kUpperCaseSmallCapsSelector, data);
|
if (value != 0)
|
||||||
break;
|
pcall(p, kUpperCaseType, kUpperCaseSmallCapsSelector);
|
||||||
case uiAttributeCapFormPetiteCaps:
|
break;
|
||||||
(*f)(kUpperCaseType, kUpperCasePetiteCapsSelector, data);
|
case mkTag('c', '2', 'p', 'c'):
|
||||||
break;
|
if (value != 0)
|
||||||
}
|
pcall(p, kUpperCaseType, kUpperCasePetiteCapsSelector);
|
||||||
return 1;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue