diff --git a/common/attrlist.c b/common/attrlist.c index 9a785dd3..e4c8ad67 100644 --- a/common/attrlist.c +++ b/common/attrlist.c @@ -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 diff --git a/darwin/attrstr.m b/darwin/attrstr.m index c383ab59..cf6fde17 100644 --- a/darwin/attrstr.m +++ b/darwin/attrstr.m @@ -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; diff --git a/examples/drawtext/attributes.c b/examples/drawtext/attributes.c index 543ba94c..7599dcfc 100644 --- a/examples/drawtext/attributes.c +++ b/examples/drawtext/attributes.c @@ -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"; } diff --git a/ui_attrstr.h b/ui_attrstr.h index 4fa90aea..6d6021d2 100644 --- a/ui_attrstr.h +++ b/ui_attrstr.h @@ -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,