![]() In FontForge, I can only work on a single line of text at a time. (That’s 1378 pairs.) I even kerned combinations that will probably never be used, like qm and kB. ![]() Oh, how I have kerning woes.Īll letter pairs have been kerned, for all 52 letters. There is also a glyph (U+1F381) for a wrapped present, which is how I was able to see this lovely note in my spam folder: There’s another block for “Transportation and Map Symbols,” as well as the three mysteriously-named blocks “Miscellaneous Symbols,” “Miscellaneous Symbols and Pictographs,” and “Supplemental Symbols and Pictographs.” With these glyphs, the world’s need is fulfilled for symbols of beer mugs, pig noses, Dromedary camels (with the helpful note “has a single hump”), hot dogs, tacos, baby angels, and alien monsters. For some reason, may of them have cat ears, because of course they do. The next block is “Emoticons,” which in the Unicode platonic ideal, consists of actual smiley faces, not emoticons built out of punctuation marks. But this was not enough for Unicode oh, no. These are pretty standard-looking typographical symbols, such as numerals inside circles, arrows, stars, and hearts. The first block of Unicode dingbats (U+2700–U+27BF) consists mainly of glyphs from ITC Zapf Dingbats, an early dingbat font. With a universal character encoding system, why relegate dingbats only to specialty fonts that confound anyone exploring their word processor’s Fonts menu for the first time? Any font can now have a full complement of dingbats! (Whoever drew the cat glpyh in Webdings, however, should really bone up on what cats actually look like.) ![]() Some fonts consist entirely of dingbats, such as Wingdings and Webdings. With the advent of digital fonts, there has been an explosion of dingbats. Not bad… Now Emacs is my font editor! The code is at. This code actually generates the test file:įrom yattag import Doc import numpy as np import aglfn > doc, tag, text, line = Doc().ttl() fonts =, ,, ] strings = offsets = np.asarray(kerning_matrix) classes_left = ] classes_right = ] with tag( 'html'): with tag( 'head'): doc.asis(test_css(fonts)) with tag( 'body'): line( 'h1', 'Test headings') with tag( 'div', klass= "blog-heading"): doc.asis(test_html(strings)) line( 'h1', 'Kerning matrix') doc.asis(test_kerning_matrix(kerning_matrix)) return doc.getvalue()Īnd here's what that test.html looks like: Testing the font with a few blog headings Kerning pairs: black for specified pairs, gray for defaults > font = fontforge.font() font = import_glyphs(font, params) font = set_bearings(font, bearings) save_font(font, ") return doc.getvalue() def test_html(strings): doc, tag, text, line = Doc().ttl() with doc.tag( 'table', style= 'border-bottom: 1px solid gray width: 100% border-collapse: collapse'): for s in strings: for i, f in enumerate(fonts): style = 'border-top: 1px solid gray' if (i = 0) else "" with tag( 'tr', klass=f, style=style): line( 'td', f) line( 'td', s) return doc.getvalue() def test_kerning_matrix(kerning_matrix): doc, tag, text, line = Doc().ttl() with tag( 'table'): for r, row in enumerate(classes_left): if row is None: continue for first_letter in row: with tag( 'tr'): line( 'td', first_letter) for c, column in enumerate(classes_right): if column is None: continue for second_letter in column: klass = "kerned" if kerning_matrix else "default" line( 'td', aglfn.to_glyph(first_letter) + aglfn.to_glyph(second_letter), klass=klass) return doc.getvalue() By arranging my Emacs windows a certain way and adding :eval no to the Org Babel blocks I'm not currently using, I can easily change the relevant table entries and evaluate the whole buffer to regenerate the font versions, including exports to OTF and WOFF. ![]() If I execute a little bit of source code in my Org Mode, though, I can use my test web page to view all the different versions. This was a hassle with FontForge, since I had to open different font files in different Metrics windows. I wanted to be able to easily compare different versions of my font: my original glyphs versus my tweaked glyphs, simple spacing versus kerned. ![]() Def kern_by_char(font, kerning_matrix): # Add kerning by character as backup font.addLookupSubtable( "kern", "kern-2") offsets = np.asarray(kerning_matrix) classes_right = ] classes_left = ] for r, row in enumerate(classes_left): if row is None: continue for first_letter in row: g = font.createMappedChar(first_letter) for c, column in enumerate(classes_right): if column is None: continue for second_letter in column: if kerning_matrix: g.addPosSub( "kern-2", second_letter, 0, 0, kerning_matrix, 0, 0, 0, 0, 0) return font ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |