Added vertical glyph forms. Next up is the rest of the various font features.

This commit is contained in:
Pietro Gagliardi 2017-02-13 10:24:12 -05:00
parent 1c238bf85b
commit ff986858f1
4 changed files with 19 additions and 3 deletions

View File

@ -302,6 +302,8 @@ static int specsIdentical(struct attr *attr, uiAttributeSpec *spec)
attr->spec.G == spec->G &&
attr->spec.B == spec->B &&
attr->spec.A == spec->A;
case uiAttributeVerticalForms:
return 1;
// TODO
}
// handles the rest

View File

@ -122,6 +122,9 @@ static int processAttribute(uiAttributedString *s, uiAttributeSpec *spec, size_t
[p->backgroundBlocks addObject:block];
Block_release(block);
break;
case uiAttributeVerticalForms:
CFAttributedStringSetAttribute(p->mas, range, kCTVerticalFormsAttributeName, kCFBooleanTrue);
break;
// TODO
}
return 0;

View File

@ -91,6 +91,16 @@ static void setupAttributedString(void)
uiAttributedStringAppendUnattributed(attrstr, ", ");
next = "vertical glyph forms";
start = uiAttributedStringLen(attrstr);
end = start + strlen(next);
uiAttributedStringAppendUnattributed(attrstr, next);
spec.Type = uiAttributeVerticalForms;
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
uiAttributedStringAppendUnattributed(attrstr, " (which you can draw rotated for proper vertical text)");
uiAttributedStringAppendUnattributed(attrstr, ", ");
next = "multiple TODO";
}

View File

@ -3,12 +3,13 @@ typedef struct uiAttributeSpec uiAttributeSpec;
_UI_ENUM(uiAttribute) {
uiAttributeFamily,
uiAttributeSize, // use Double
uiAttributeSize, // use Double
uiAttributeWeight,
uiAttributeItalic,
uiAttributeStretch,
uiAttributeColor, // use R, G, B, A
uiAttributeBackground, // use R, G, B, A
uiAttributeColor, // use R, G, B, A
uiAttributeBackground, // use R, G, B, A
uiAttributeVerticalForms, // no parameter
// TODO
// TODO uiAttributeSystem,
// TODO uiAttributeCustom,