diff --git a/examples/drawtext/attributes.c b/examples/drawtext/attributes.c index 6e54dfcb..c3da5581 100644 --- a/examples/drawtext/attributes.c +++ b/examples/drawtext/attributes.c @@ -139,6 +139,31 @@ static void setupAttributedString(void) uiAttributedStringAppendUnattributed(attrstr, ", "); + next = "\xD0\xB1\xD0\xB3\xD0\xB4\xD0\xBF\xD1\x82"; + uiAttributedStringAppendUnattributed(attrstr, "multiple languages (compare "); + start = uiAttributedStringLen(attrstr); + end = start + strlen(next); + uiAttributedStringAppendUnattributed(attrstr, next); + spec.Type = uiAttributeItalic; + spec.Value = uiDrawTextItalicItalic; + uiAttributedStringSetAttribute(attrstr, &spec, start, end); + spec.Type = uiAttributeLanguage; + spec.Value = (uintptr_t) "ru"; + uiAttributedStringSetAttribute(attrstr, &spec, start, end); + uiAttributedStringAppendUnattributed(attrstr, " to "); + start = uiAttributedStringLen(attrstr); + end = start + strlen(next); + uiAttributedStringAppendUnattributed(attrstr, next); + spec.Type = uiAttributeItalic; + spec.Value = uiDrawTextItalicItalic; + uiAttributedStringSetAttribute(attrstr, &spec, start, end); + spec.Type = uiAttributeLanguage; + spec.Value = (uintptr_t) "sr"; + uiAttributedStringSetAttribute(attrstr, &spec, start, end); + uiAttributedStringAppendUnattributed(attrstr, " \xE2\x80\x94 may require changing the font)"); + + uiAttributedStringAppendUnattributed(attrstr, ", "); + next = "multiple TODO"; } diff --git a/examples/drawtext/main.c b/examples/drawtext/main.c index 822382d0..848def89 100644 --- a/examples/drawtext/main.c +++ b/examples/drawtext/main.c @@ -1,6 +1,11 @@ // 17 january 2017 #include "drawtext.h" +// okay everything is definitely bugged in the OS X code +// - occasional segfaults on startup +// - very rare size attributes in the attributed string example don't terminate for a while, making everything big +// - very very rare trace/bpt faults on startup + static uiWindow *mainwin; static uiBox *box; static uiCombobox *exampleList;