2017-02-15 20:11:44 -06:00
|
|
|
// 14 february 2017
|
|
|
|
#import "uipriv_darwin.h"
|
|
|
|
|
2017-05-30 13:38:25 -05:00
|
|
|
// TODO explain the purpose of this file
|
|
|
|
|
2017-05-30 13:00:58 -05:00
|
|
|
static void boolspec(uint32_t value, uint16_t type, uint16_t ifTrue, uint16_t ifFalse, aatBlock f)
|
2017-02-15 20:11:44 -06:00
|
|
|
{
|
2017-05-19 14:14:41 -05:00
|
|
|
// TODO are values other than 1 accepted for true by OpenType itself? (same for the rest of the file)
|
|
|
|
if (value != 0) {
|
2017-05-30 13:00:58 -05:00
|
|
|
f(type, ifTrue);
|
2017-02-15 20:11:44 -06:00
|
|
|
return;
|
|
|
|
}
|
2017-05-30 13:00:58 -05:00
|
|
|
f(type, ifFalse);
|
2017-02-15 20:11:44 -06:00
|
|
|
}
|
|
|
|
|
2017-05-19 15:10:54 -05:00
|
|
|
// TODO double-check drawtext example to make sure all of these are used properly (I already screwed dlig up by putting clig twice instead)
|
2017-05-30 13:00:58 -05:00
|
|
|
void openTypeToAAT(char a, char b, char c, char d, uint32_t value, aatBlock f)
|
2017-02-15 20:11:44 -06:00
|
|
|
{
|
2017-05-19 14:14:41 -05:00
|
|
|
switch (mkTag(a, b, c, d)) {
|
|
|
|
case mkTag('l', 'i', 'g', 'a'):
|
|
|
|
boolspec(value, kLigaturesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kCommonLigaturesOnSelector,
|
|
|
|
kCommonLigaturesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('r', 'l', 'i', 'g'):
|
|
|
|
boolspec(value, kLigaturesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kRequiredLigaturesOnSelector,
|
|
|
|
kRequiredLigaturesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('d', 'l', 'i', 'g'):
|
|
|
|
boolspec(value, kLigaturesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kRareLigaturesOnSelector,
|
|
|
|
kRareLigaturesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', 'l', 'i', 'g'):
|
|
|
|
boolspec(value, kLigaturesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kContextualLigaturesOnSelector,
|
|
|
|
kContextualLigaturesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('h', 'l', 'i', 'g'):
|
|
|
|
// 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,
|
2017-02-15 20:11:44 -06:00
|
|
|
kHistoricalLigaturesOnSelector,
|
|
|
|
kHistoricalLigaturesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('u', 'n', 'i', 'c'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// TODO is this correct, or should we provide an else case?
|
2017-05-19 14:14:41 -05:00
|
|
|
if (value != 0)
|
2017-02-15 20:11:44 -06:00
|
|
|
// this is undocumented; it comes from Core Text's internal AAT-to-OpenType conversion table
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kLetterCaseType, 14);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('p', 'n', 'u', 'm'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kNumberSpacingType, kProportionalNumbersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('t', 'n', 'u', 'm'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kNumberSpacingType, kMonospacedNumbersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('s', 'u', 'p', 's'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kVerticalPositionType, kSuperiorsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 'u', 'b', 's'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kVerticalPositionType, kInferiorsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('o', 'r', 'd', 'n'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kVerticalPositionType, kOrdinalsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 'i', 'n', 'f'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kVerticalPositionType, kScientificInferiorsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('a', 'f', 'r', 'c'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kFractionsType, kVerticalFractionsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('f', 'r', 'a', 'c'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kFractionsType, kDiagonalFractionsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
case mkTag('z', 'e', 'r', 'o'):
|
|
|
|
boolspec(value, kTypographicExtrasType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kSlashedZeroOnSelector,
|
|
|
|
kSlashedZeroOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('m', 'g', 'r', 'k'):
|
|
|
|
boolspec(value, kMathematicalExtrasType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kMathematicalGreekOnSelector,
|
|
|
|
kMathematicalGreekOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('o', 'r', 'n', 'm'):
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kOrnamentSetsType, (uint16_t) value);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('a', 'a', 'l', 't'):
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterAlternativesType, (uint16_t) value);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('t', 'i', 't', 'l'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// TODO is this correct, or should we provide an else case?
|
2017-05-19 15:10:54 -05:00
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kStyleOptionsType, kTitlingCapsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('t', 'r', 'a', 'd'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kTraditionalCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 'm', 'p', 'l'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kSimplifiedCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('j', 'p', '7', '8'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kJIS1978CharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('j', 'p', '8', '3'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kJIS1983CharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('j', 'p', '9', '0'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kJIS1990CharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('e', 'x', 'p', 't'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kExpertCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('j', 'p', '0', '4'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kJIS2004CharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('h', 'o', 'j', 'o'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kHojoCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('n', 'l', 'c', 'k'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kNLCCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('t', 'n', 'a', 'm'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kCharacterShapeType, kTraditionalNamesCharactersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
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'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// TODO is this correct, or should we provide an else case?
|
2017-05-19 14:14:41 -05:00
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kNumberCaseType, kLowerCaseNumbersSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('h', 'n', 'g', 'l'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// TODO is this correct, or should we provide an else case?
|
2017-05-19 14:14:41 -05:00
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kTransliterationType, kHanjaToHangulSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('n', 'a', 'l', 't'):
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kAnnotationType, (uint16_t) value);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('r', 'u', 'b', 'y'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// include this for completeness
|
2017-05-19 14:14:41 -05:00
|
|
|
boolspec(value, kRubyKanaType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kRubyKanaSelector,
|
|
|
|
kNoRubyKanaSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-02-15 20:11:44 -06:00
|
|
|
// this is the current one
|
2017-05-19 14:14:41 -05:00
|
|
|
boolspec(value, kRubyKanaType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kRubyKanaOnSelector,
|
|
|
|
kRubyKanaOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('i', 't', 'a', 'l'):
|
2017-02-15 20:11:44 -06:00
|
|
|
// include this for completeness
|
2017-05-19 14:14:41 -05:00
|
|
|
boolspec(value, kItalicCJKRomanType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kCJKItalicRomanSelector,
|
|
|
|
kNoCJKItalicRomanSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-02-15 20:11:44 -06:00
|
|
|
// this is the current one
|
2017-05-19 14:14:41 -05:00
|
|
|
boolspec(value, kItalicCJKRomanType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kCJKItalicRomanOnSelector,
|
|
|
|
kCJKItalicRomanOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', 'a', 's', 'e'):
|
|
|
|
boolspec(value, kCaseSensitiveLayoutType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kCaseSensitiveLayoutOnSelector,
|
|
|
|
kCaseSensitiveLayoutOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', 'p', 's', 'p'):
|
|
|
|
boolspec(value, kCaseSensitiveLayoutType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kCaseSensitiveSpacingOnSelector,
|
|
|
|
kCaseSensitiveSpacingOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('h', 'k', 'n', 'a'):
|
|
|
|
boolspec(value, kAlternateKanaType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kAlternateHorizKanaOnSelector,
|
|
|
|
kAlternateHorizKanaOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('v', 'k', 'n', 'a'):
|
|
|
|
boolspec(value, kAlternateKanaType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kAlternateVertKanaOnSelector,
|
|
|
|
kAlternateVertKanaOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '1'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltOneOnSelector,
|
|
|
|
kStylisticAltOneOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '2'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltTwoOnSelector,
|
|
|
|
kStylisticAltTwoOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '3'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltThreeOnSelector,
|
|
|
|
kStylisticAltThreeOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '4'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltFourOnSelector,
|
|
|
|
kStylisticAltFourOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '5'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltFiveOnSelector,
|
|
|
|
kStylisticAltFiveOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '6'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltSixOnSelector,
|
|
|
|
kStylisticAltSixOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '7'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltSevenOnSelector,
|
|
|
|
kStylisticAltSevenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '8'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltEightOnSelector,
|
|
|
|
kStylisticAltEightOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '0', '9'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltNineOnSelector,
|
|
|
|
kStylisticAltNineOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '0'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltTenOnSelector,
|
|
|
|
kStylisticAltTenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '1'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltElevenOnSelector,
|
|
|
|
kStylisticAltElevenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '2'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltTwelveOnSelector,
|
|
|
|
kStylisticAltTwelveOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '3'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltThirteenOnSelector,
|
|
|
|
kStylisticAltThirteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '4'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltFourteenOnSelector,
|
|
|
|
kStylisticAltFourteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '5'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltFifteenOnSelector,
|
|
|
|
kStylisticAltFifteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '6'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltSixteenOnSelector,
|
|
|
|
kStylisticAltSixteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '7'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltSeventeenOnSelector,
|
|
|
|
kStylisticAltSeventeenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '8'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltEighteenOnSelector,
|
|
|
|
kStylisticAltEighteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '1', '9'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltNineteenOnSelector,
|
|
|
|
kStylisticAltNineteenOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 's', '2', '0'):
|
|
|
|
boolspec(value, kStylisticAlternativesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kStylisticAltTwentyOnSelector,
|
|
|
|
kStylisticAltTwentyOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', 'a', 'l', 't'):
|
|
|
|
boolspec(value, kContextualAlternatesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kContextualAlternatesOnSelector,
|
|
|
|
kContextualAlternatesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('s', 'w', 's', 'h'):
|
|
|
|
boolspec(value, kContextualAlternatesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kSwashAlternatesOnSelector,
|
|
|
|
kSwashAlternatesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', 's', 'w', 'h'):
|
|
|
|
boolspec(value, kContextualAlternatesType,
|
2017-02-15 20:11:44 -06:00
|
|
|
kContextualSwashAlternatesOnSelector,
|
|
|
|
kContextualSwashAlternatesOffSelector,
|
2017-05-30 13:00:58 -05:00
|
|
|
f);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('s', 'm', 'c', 'p'):
|
|
|
|
if (value != 0) {
|
2017-02-15 20:11:44 -06:00
|
|
|
// include this for compatibility (some fonts that come with OS X still use this!)
|
|
|
|
// TODO make it boolean?
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kLetterCaseType, kSmallCapsSelector);
|
2017-02-15 20:11:44 -06:00
|
|
|
// this is the current one
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kLowerCaseType, kLowerCaseSmallCapsSelector);
|
2017-02-15 20:11:44 -06:00
|
|
|
}
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('p', 'c', 'a', 'p'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kLowerCaseType, kLowerCasePetiteCapsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO will the following handle all cases properly, or are elses going to be needed?
|
|
|
|
case mkTag('c', '2', 's', 'c'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kUpperCaseType, kUpperCaseSmallCapsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
|
|
|
case mkTag('c', '2', 'p', 'c'):
|
|
|
|
if (value != 0)
|
2017-05-30 14:24:31 -05:00
|
|
|
f(kUpperCaseType, kUpperCasePetiteCapsSelector);
|
2017-05-19 14:14:41 -05:00
|
|
|
break;
|
2017-02-15 20:11:44 -06:00
|
|
|
}
|
2017-05-19 14:48:15 -05:00
|
|
|
// TODO handle this properly
|
2017-05-30 13:00:58 -05:00
|
|
|
// (it used to return 0 when this still returned the number of selectors produced but IDK what properly is anymore)
|
2017-02-15 20:11:44 -06:00
|
|
|
}
|