Polished up the drawtext demo a bit (such as finally fixing that titlebar). Also more crash-related TODOs.
This commit is contained in:
parent
bc895d6707
commit
9aea7fa62e
|
@ -2,6 +2,9 @@
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
#import "attrstr.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:
|
// Core Text exposes font style info in two forms:
|
||||||
// - Fonts with a QuickDraw GX font variation (fvar) table, a feature
|
// - Fonts with a QuickDraw GX font variation (fvar) table, a feature
|
||||||
// adopted by OpenType, expose variations directly.
|
// adopted by OpenType, expose variations directly.
|
||||||
|
|
|
@ -88,7 +88,9 @@ static void makeAttributedString(void)
|
||||||
attr = uiNewFeaturesAttribute(otf);
|
attr = uiNewFeaturesAttribute(otf);
|
||||||
appendWithAttribute("afford", attr, NULL);
|
appendWithAttribute("afford", attr, NULL);
|
||||||
uiFreeOpenTypeFeatures(otf);
|
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)
|
static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
|
||||||
|
@ -172,7 +174,7 @@ int main(void)
|
||||||
|
|
||||||
makeAttributedString();
|
makeAttributedString();
|
||||||
|
|
||||||
mainwin = uiNewWindow("libui Histogram Example", 640, 480, 1);
|
mainwin = uiNewWindow("libui Text-Drawing Example", 640, 480, 1);
|
||||||
uiWindowSetMargined(mainwin, 1);
|
uiWindowSetMargined(mainwin, 1);
|
||||||
uiWindowOnClosing(mainwin, onClosing, NULL);
|
uiWindowOnClosing(mainwin, onClosing, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue