diff options
author | Dante Catalfamo | 2022-01-22 19:25:03 -0500 |
---|---|---|
committer | Dante Catalfamo | 2022-01-22 19:25:03 -0500 |
commit | 90590179c8b37394d36822f1b6a8474a17cfd163 (patch) | |
tree | 45f4303cf5cd5c9a5d1dfafda203914da4119cbb | |
parent | b2f6600aa8b280fd2d1ec411306ac445009558d9 (diff) | |
download | blog-90590179c8b37394d36822f1b6a8474a17cfd163.tar.gz blog-90590179c8b37394d36822f1b6a8474a17cfd163.tar.bz2 blog-90590179c8b37394d36822f1b6a8474a17cfd163.zip |
opentype-features: Add blog post about opentype
-rw-r--r-- | content/posts/opentype-font-exploration/index.org | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/content/posts/opentype-font-exploration/index.org b/content/posts/opentype-font-exploration/index.org new file mode 100644 index 0000000..91cd4fe --- /dev/null +++ b/content/posts/opentype-font-exploration/index.org @@ -0,0 +1,73 @@ +#+TITLE: Exploring OpenType Font Features +#+DATE: 2022-01-22T19:10:17-05:00 +#+DRAFT: true +#+DESCRIPTION: Checking out the OpenType features of a font +#+TAGS[]: font emacs +#+KEYWORDS[]: +#+SLUG: +#+SUMMARY: + +I just bought a new font to use as my primary face in Emacs. It's a +cool one called [[https://www.monolisa.dev][MonoLisa]], I think it looks great. + +It has a nice looking script variant that lets you turn your italics +into a cursive looking font. Unfortunately it's a fancy OpenType +feature that most things, including Emacs don't support properly yet. + +In their [[https://www.monolisa.dev/faq][FAQ]] they mention that you can use a tool called [[https://github.com/twardoch/fonttools-opentype-feature-freezer][OpenType +Feature Freezer]] to modify the font so that the optional glyphs become +the default. They get used all the time without requiring the editor +to properly support the OpenType feature. + +Other than telling you that it's possible they don't actually tell you +which features are available and what they look like. + +Fortunately the Feature Freezer tool can help us here. If you pass it +the =-r= flag, it will list out the features supported by the font. + +#+begin_src shell +pyftfeatfreeze -r MonoLisa-RegularItalic.otf +# Scripts and languages: +-s 'DFLT' +-s 'cyrl' +-s 'cyrl' -l 'BGR ' +-s 'cyrl' -l 'SRB ' +-s 'latn' +-s 'latn' -l 'AZE ' +-s 'latn' -l 'CRT ' +-s 'latn' -l 'KAZ ' +-s 'latn' -l 'MOL ' +-s 'latn' -l 'ROM ' +-s 'latn' -l 'TAT ' +-s 'latn' -l 'TRK ' +# Features: +-f aalt,calt,case,ccmp,dnom,frac,liga,locl,numr,onum,ordn,salt,sinf,ss01,ss02,ss05,ss06,subs,sups,zero +#+end_src + + +While it's possible to find a list of what the OpenType features do on +[[https://en.wikipedia.org/wiki/List_of_typographic_features][Wikipedia]], we're still left not knowing what the Stylistic Sets are. + +Once we have a list of features supported by the font, it's possible +to test these features out on the MonoLisa website by modifying CSS +variables. + +If we load the [[https://www.monolisa.dev/specimen][specimin]] or [[https://www.monolisa.dev/playground][playground]] page and find the CSS rule that +sets the font for the page, we can add =font-feature-settings:= rules +to test out the different options. + +For example, if we add =font-feature-settings: "ss02";=, this will +enable the =ss02= feature on all text on the website. We can then go +through each of the features listed out by the Feature Freezer and try +them all out. + +From there we can figure out which features we want to enable and pass +them to as arguments to the Feature Freezer and produce a font we with +those features enabled by default. + +If we wanted to produce a font with the =ss01= and =ss02= features +enabled by default, we could then run this command. + +#+begin_src shell +pyftfeatfreeze -n -v -f ‘ss01,ss02’ source-font.otf output-font.otf +#+end_src |