Polished up the drawtext demo a bit (such as finally fixing that titlebar). Also more crash-related TODOs.

This commit is contained in:
Pietro Gagliardi 2018-03-18 11:24:09 -04:00
parent bc895d6707
commit 9aea7fa62e
2 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,9 @@
#import "uipriv_darwin.h"
#import "attrstr.h"
// TODOs:
// - switching from Skia to a non-fvar-based font crashes because the CTFontDescriptorRef we get has an empty variation dictionary for some reason...
// Core Text exposes font style info in two forms:
// - Fonts with a QuickDraw GX font variation (fvar) table, a feature
// adopted by OpenType, expose variations directly.

View File

@ -88,7 +88,9 @@ static void makeAttributedString(void)
attr = uiNewFeaturesAttribute(otf);
appendWithAttribute("afford", attr, NULL);
uiFreeOpenTypeFeatures(otf);
uiAttributedStringAppendUnattributed(attrstr, ").");
uiAttributedStringAppendUnattributed(attrstr, ").\n");
uiAttributedStringAppendUnattributed(attrstr, "Use the controls opposite to the text to control properties of the text.");
}
static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
@ -172,7 +174,7 @@ int main(void)
makeAttributedString();
mainwin = uiNewWindow("libui Histogram Example", 640, 480, 1);
mainwin = uiNewWindow("libui Text-Drawing Example", 640, 480, 1);
uiWindowSetMargined(mainwin, 1);
uiWindowOnClosing(mainwin, onClosing, NULL);