More examples and crash fixes.
This commit is contained in:
parent
e27e51c4b8
commit
025dd16d76
|
@ -298,9 +298,9 @@ CTFontDescriptorRef fontdescAppendFeatures(CTFontDescriptorRef desc, const uint1
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we have to take care of the language
|
// now we have to take care of the language
|
||||||
// TODO can we assume this is present?
|
|
||||||
if (language != NULL) {
|
if (language != NULL) {
|
||||||
languages = CTFontDescriptorCopyAttribute(desc, kCTFontLanguagesAttribute);
|
languages = CTFontDescriptorCopyAttribute(desc, kCTFontLanguagesAttribute);
|
||||||
|
if (languages != NULL) {
|
||||||
nl = CFArrayGetCount(languages);
|
nl = CFArrayGetCount(languages);
|
||||||
d[0] = language[0];
|
d[0] = language[0];
|
||||||
if (d[0] >= 'A' && d[0] <= 'Z')
|
if (d[0] >= 'A' && d[0] <= 'Z')
|
||||||
|
@ -349,6 +349,7 @@ CTFontDescriptorRef fontdescAppendFeatures(CTFontDescriptorRef desc, const uint1
|
||||||
}
|
}
|
||||||
CFRelease(languages);
|
CFRelease(languages);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
keys[0] = kCTFontFeatureSettingsAttribute;
|
keys[0] = kCTFontFeatureSettingsAttribute;
|
||||||
values[0] = outerArray;
|
values[0] = outerArray;
|
||||||
|
|
|
@ -8,6 +8,7 @@ static void setupAttributedString(void)
|
||||||
uiAttributeSpec spec;
|
uiAttributeSpec spec;
|
||||||
size_t start, end;
|
size_t start, end;
|
||||||
const char *next;
|
const char *next;
|
||||||
|
int i;
|
||||||
|
|
||||||
attrstr = uiNewAttributedString("uiAttributedString isn't just for plain text! It supports ");
|
attrstr = uiNewAttributedString("uiAttributedString isn't just for plain text! It supports ");
|
||||||
|
|
||||||
|
@ -355,7 +356,60 @@ static void setupAttributedString(void)
|
||||||
|
|
||||||
uiAttributedStringAppendUnattributed(attrstr, ", ");
|
uiAttributedStringAppendUnattributed(attrstr, ", ");
|
||||||
|
|
||||||
next = "TODO mathematical greek";
|
next = "\xCE\xA0\xCE\xA3";
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, "mathematical greek (");
|
||||||
|
start = uiAttributedStringLen(attrstr);
|
||||||
|
end = start + strlen(next);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, next);
|
||||||
|
spec.Type = uiAttributeMathematicalGreek;
|
||||||
|
spec.Value = 0;
|
||||||
|
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, " vs. ");
|
||||||
|
start = uiAttributedStringLen(attrstr);
|
||||||
|
end = start + strlen(next);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, next);
|
||||||
|
spec.Type = uiAttributeMathematicalGreek;
|
||||||
|
spec.Value = 1;
|
||||||
|
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ")");
|
||||||
|
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ", ");
|
||||||
|
|
||||||
|
next = "qwertyuiop\xE2\x80\xA2";
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, "ornamental forms (");
|
||||||
|
for (i = 1; i < 11; i++) {
|
||||||
|
start = uiAttributedStringLen(attrstr);
|
||||||
|
end = start + strlen(next);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, next);
|
||||||
|
spec.Type = uiAttributeOrnamentalForms;
|
||||||
|
spec.Value = (uintptr_t) i;
|
||||||
|
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
|
||||||
|
next = "\xE2\x80\xA2";
|
||||||
|
}
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ")");
|
||||||
|
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ", ");
|
||||||
|
|
||||||
|
next = "g";
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, "specific forms/alternates (");
|
||||||
|
start = uiAttributedStringLen(attrstr);
|
||||||
|
end = start + strlen(next);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, next);
|
||||||
|
spec.Type = uiAttributeSpecificCharacterForm;
|
||||||
|
spec.Value = 0;
|
||||||
|
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, " vs. ");
|
||||||
|
start = uiAttributedStringLen(attrstr);
|
||||||
|
end = start + strlen(next);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, next);
|
||||||
|
spec.Type = uiAttributeSpecificCharacterForm;
|
||||||
|
spec.Value = 1;
|
||||||
|
uiAttributedStringSetAttribute(attrstr, &spec, start, end);
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ")");
|
||||||
|
|
||||||
|
uiAttributedStringAppendUnattributed(attrstr, ", ");
|
||||||
|
|
||||||
|
next = "TODO titling capitals";
|
||||||
}
|
}
|
||||||
|
|
||||||
static char fontFamily[] = "Times New Roman";
|
static char fontFamily[] = "Times New Roman";
|
||||||
|
|
Loading…
Reference in New Issue