diff --git a/TODO.md b/TODO.md index 33ac95af..8bf48004 100644 --- a/TODO.md +++ b/TODO.md @@ -127,3 +127,46 @@ label shortcut keys [02:15:00] 1.40.3 [02:20:46] I'll ahve to keep this in mind then, thanks [02:20:59] if only there was a cairo-specific attribute for alpha... + +FONT LOADING + +[00:10:08] andlabs: is there API yet to load from memory? last i checked i only found from file (which we use in builder). https://git.gnome.org/browse/gnome-builder/tree/libide/editor/ide-editor-map-bin.c#n115 +[00:13:12] mrmcq2u_ (mrmcq2u@109.79.53.90) joined the channel +[00:14:59] mrmcq2u (mrmcq2u@109.79.73.102) left IRC (Ping timeout: 181 seconds) +[00:15:19] hergertme: no, which is why I was asking =P +[00:15:30] I would have dug down if I could ensure at least something about the backends a GTK+ 3 program uses +[00:15:39] on all platforms except windows and os x +[00:16:11] to the best of my (partially outdated, given pace of foss) knowledge there isn't an api to load from memory +[00:16:28] you can possibly make a tmpdir and put a temp file in there +[00:16:52] and load that as your font dir in your FcConfig, so any PangoFontDescription would point to that one font, no matter what +[00:17:18] (using the API layed out in that link) +[00:18:18] dsr1014__ (dsr1014@c-73-72-102-18.hsd1.il.comcast.net) joined the channel +[00:35:18] simukis_ (simukis@78-60-58-6.static.zebra.lt) left IRC (Quit: simukis_) +[00:35:48] dreamon_ (dreamon@ppp-188-174-49-41.dynamic.mnet-online.de) joined the channel +[00:40:09] samtoday_ (samtoday@114-198-116-132.dyn.iinet.net.au) joined the channel +[00:40:32] mjog (mjog@120.18.225.46) joined the channel +[00:40:38] hergertme: not necessarily fontconfig +[00:40:45] it can be with ft2 or xft I guess +[00:40:55] especially since I want the API NOT to make the font part of the font panel +[00:42:07] what sort of deprecated code are you trying to support? +[00:42:35] both of those are deprecated in pango fwiw +[00:43:06] on Linux im pretty sure we use FC everywhere these days +[00:44:46] (and gtk_widget_set_font_map() is how you get your custom font into a widget without affecting the global font lists, as layed out in that link) +[00:49:14] vasaikar (vasaikar@125.16.97.121) joined the channel +[00:50:14] karlt (karl@2400:e780:801:224:f121:e611:d139:e70e) left IRC (Client exited) +[00:50:49] karlt (karl@2400:e780:801:224:f121:e611:d139:e70e) joined the channel +[00:51:43] PioneerAxon (PioneerAxo@122.171.61.146) left IRC (Ping timeout: 180 seconds) +[00:57:47] PioneerAxon (PioneerAxo@106.201.37.181) joined the channel +[01:03:01] karlt (karl@2400:e780:801:224:f121:e611:d139:e70e) left IRC (Ping timeout: 181 seconds) +[01:05:49] muhannad (muhannad@95.218.26.152) left IRC (Quit: muhannad) +[01:07:51] hergertme: hm +[01:07:54] all right, thanks +[01:08:05] hergertme: fwiw right now my requirement is 3.10 +[01:10:47] ah, well you'll probably be missing the neccesary font API on gtk_widget +[01:11:04] but pango should be fine even back as far as https://developer.gnome.org/pango/1.28/PangoFcFontMap.html +[01:11:56] good +[01:12:04] because this is for custom drawing into a DrawingArea +[01:14:12] presumably just create your PangoContext as normal, but call pango_context_set_font_map() with the map you've setup. now, the load a font from a file i dont think was added to FontConfig until later though (not sure what release) +[01:15:53] FcConfigAppFontAddFile() <-- that API +[01:16:30] great, and they don't say what version the API was added in teh docs +function: ide_editor_map_bin_add() diff --git a/common/opentype.c b/common/opentype.c index 282df9ba..f874752b 100644 --- a/common/opentype.c +++ b/common/opentype.c @@ -60,7 +60,6 @@ void specToOpenType(uiAttributeSpec *spec, specToOpenTypeEnumFunc f, void *data) break; } return; - // TODO is this correct or should we explicitly switch the rest off too? case uiAttributeSuperscripts: switch (spec->Value) { case uiAttributeSuperscriptSuperscript: @@ -150,6 +149,9 @@ void specToOpenType(uiAttributeSpec *spec, specToOpenTypeEnumFunc f, void *data) case uiAttributeGlyphAnnotations: (*f)("nalt", (uint32_t) (spec->Value), data); return; + case uiAttributeRubyKanaForms: + boolspec(spec, "ruby", data); + return; case uiAttributeCJKRomanToitalics: boolspec(spec, "ital", data); return; @@ -261,12 +263,9 @@ void specToOpenType(uiAttributeSpec *spec, specToOpenTypeEnumFunc f, void *data) // TODO missing that AAT uses directly: // - pkna, pwid, fwid, hwid, twid, qwid, palt, valt, vpal, halt, vhal, kern, vkrn (CJK width control) -// - ruby // missing that AAT knows about: // - ccmp (compositions) -// - curs (cursive positioning) -// - Core Text uses this in language-specific stuff -// - dnom, numr (fraction parts) +// - dnom, numr (fraction parts) — no AAT equivalent... // - falt, jalt (Arabic support) // - rclt (required contextual alternates) // - lfbd, opbd, rtbd (optical bounds support) @@ -288,6 +287,7 @@ void specToOpenType(uiAttributeSpec *spec, specToOpenTypeEnumFunc f, void *data) // blwm yes yes // blws yes TODO // cjct yes yes +// curs yes yes // dist yes yes // falt TODO TODO // fin2 yes yes diff --git a/ui_attrstr.h b/ui_attrstr.h index c33e3fb6..8707a375 100644 --- a/ui_attrstr.h +++ b/ui_attrstr.h @@ -24,8 +24,6 @@ _UI_ENUM(uiAttribute) { // Windows: requires Platform Update, SetLetterSpacing() // parameter meaning unspecified - // TODO kCTLigatureAttributeName vs below - uiAttributeUnderline, // enum uiDrawUnderlineStyle // TODO what is the color in the case we don't specify it, black or the text color? uiAttributeUnderlineColor, // enum uiDrawUnderlineColor @@ -35,13 +33,14 @@ _UI_ENUM(uiAttribute) { // TODO kCTBaselineClassAttributeName, kCTBaselineInfoAttributeName, kCTBaselineReferenceInfoAttributeName - // TODO kCTRubyAnnotationAttributeName vs below - // TODO strikethroughs? (pango yes, directwrite yes, os x no) // TODO baseline offsets? (pango yes) // TODO size scales? (pango yes) // TODO fallbacks (pango: enable or disable) + // TODO document that this will also enable language-specific font features (TODO on DirectWrite too?) + uiAttributeLanguage, // BCP 47 string + #if 0 // These attributes represent typographic features. Each feature @@ -79,7 +78,7 @@ _UI_ENUM(uiAttribute) { // TODO rename this uiAttributeNumberSpacings, // enum uiAttributeNumberSpacing - // TODO kSmartSwashType + // TODO kSmartSwashType, falt and jalt // TODO kDiacriticsType @@ -146,7 +145,7 @@ _UI_ENUM(uiAttribute) { // TODO kUnicodeDecompositionType - // TODO kRubyKanaType + uiAttributeRubyKanaForms, // 0 = off, 1 = on // TODO kCJKVerticalRomanPlacementType // this is 'valt' in OpenType but I don't know if I want to make it selectable or not @@ -190,8 +189,6 @@ _UI_ENUM(uiAttribute) { uiAttributeLowercaseCapForms, // enum uiAttributeCapForm uiAttributeUppercaseCapForms, // enum uiAttributeCapForm - // TODO kLanguageTagType? - // TODO kCJKRomanSpacingType #endif