TrueType hinting in 2020

I would like to ask about the “modern” TrueType hinting workflow.
Over the last few years I have been using ttfautohint --control-file.
However, manual hinting must be introduced to meet the detailed requirements of my customers.

The information I want is the following points
・Tool options
・Handling of TrueType hint when updating fonts. How can I set the TrueType instruction in the previous version of font to the next version of font?

I have no knowledge of Hinting export/import.
Are there any teaching materials to learn about the recent Hintig workflow?
I would be happy if you could give me any information.

Comments

  • In Glyphs.app, you hint the multiple master source on postscript outlines. You hint one master and they will be distributed to all (compatible) instances. So your second points is not relevant as you hints are in your master source file: https://glyphsapp.com/tutorials/hinting-manual-truetype-hinting

    And if our export as variable font, the hints work there, too.
  • VTT (Visual TrueType) is another professional tool for Hinting. 

    https://www.microsoft.com/en-us/download/details.aspx?id=100438

    VTT has a built in Autohinter. Depending on your hinting requirements, this will get you some way. The output from the Autohinter does require touchup, and VTT has quite a steep learning curve. When I worked at MS, I wrote a number of posts on using VTT to hint, unfortunately the blog has not been maintained. This post might be useful. There is also some built in help in VTT that may be useful to you.

    https://docs.microsoft.com/en-us/archive/blogs/fontblog/a-graphical-guide-to-vtt-6-10-light-latin-autohinting

    if VTT is something you think you might want to use, I may be able to give you some basic pointers and or help on that, although I am not in a position to give any extensive training or technical support. 

  • In FontLab 7: 

    1. If your source has multiple masters, you can hint the main master, and FontLab will distribute the hints to instances. 

    2. You can attach TTH commands to PostScript or TrueType contours, with overlaps. FontLab will retain the hints after you remove the overlaps. 

    3. When you create TTH commands in FontLab, the app adds names to nodes, and attaches the commands to the names. In FontLab Studio 5, TTH was based on node numbers, so it was very fragile. In FontLab 7, it’s more independent. 

    4. You can hint some key glyphs, then copy a glyph layer e.g. in "O" and then use Paste Special > TrueType hinting on "Q" or other similar glyphs, and FontLab will "magically" paste the TTH commands on the "correct" nodes. Even more — you can copy from one FontLab TTH-hinted font, and then Paste Special > TrueType hinting on glyphs from a different font, as long as the node structure is fairly similar. The same goes for copying TTH from, say, uppercase to small caps or to lowercase. 

    5. The videos by Monika Bartels https://youtu.be/L4BLqsxzlQA and https://youtu.be/2kUDCBj-NbI explain the principles of FontLab TTH. The videos use FontLab Studio 5, but the visual commands are the same in FontLab 7.

    6. Of course, FontLab 7 has a powerful TT autohinter. It can use existing PostScript hints, or build TTH commands from scratch, and in Preferences you can control which types of commands it should generate. You may want to turn off middle delta generation. 
  • Adam TwardochAdam Twardoch Posts: 507
    edited August 2020
    Here’s an example video that shows how you can copy visual TTH commands from one font to another: 

    https://www.dropbox.com/s/esib0lemtebko8g/fl7-pastespecial-truetypehinting.mp4?dl=0

    It’s important that both glyphs have the same basic contour structure and the same contour direction — but they don’t need to be point compatible.
  • This shows how copy-paste of visual TTH commands works in FontLab 7 even in quite complex glyphs: 

    https://www.dropbox.com/s/9l5wqcb40xdz622/fl7-pastespecial-truetypehinting2.mp4?dl=0

    When one glyph has no overlaps and the other does, then it does not work (since matching of the topology fails), but when the topology roughly matches, then it works. 
  • I use Visual TrueType for manual hinting. I don't use the autohinter in Visual TrueType because I find it insufficient for my purposes and does not help very much, and also replaces the cvt list.

    TrueType hinting involves writing a list of cvt values. Example (for DMCA Sans Serif 10.0 Bold in development that I'm hinting right now)

    <br>InstructionsOn @1..32767<br><br>DropOutCtrlOff @0<br><br>CvtCutIn = 1.5, 1@41, 0.5@97<br>ClearTypeCtrl = 0<br><br>LinearAdvanceWidths = 0<br><br>0: 0<br>1: 0<br>2: 0<br>3: 0<br>4: 0<br>5: 0<br>6: 0<br>7: 0<br><br>8: 0<br>9: 1004<br>Delta(0.375@1..32)<br>10: -18<br>11: 1022<br>Delta(0.25@1..32)<br>12: 199<br>Delta(0.25@15..28)<br>13: 243<br>Delta(0.5@1..12, 0.375@19..24, 0.25@25..64)<br>14: 1307<br>Delta(0.25@1..18, 0.5@19, 0.25@20..32)<br>15: 1413<br>Delta(0.5@1..12, 0.75@13, 0.25@14..18, 0.5@19, 0.25@20..32)<br>16: 1325<br>Delta(0.5@10;13;19, -0.5@35;38;41;43;46;49)<br>17: 1431<br>Delta(0.25@1..12, 0.5@13, 0.25@14..21;23..25)<br>18: -409<br>Delta(-0.25@1..20)<br>19: -427<br>20: 296<br>Delta(-0.375@1..18, 0.5@22..23;29..32)<br>21: 390<br>255: 0<br><br>

    The InstructionsOn is what range the hinting are enabled, and in this case is set
    to the maximum. However it is also possible to specify sizes for hinting (as well as anti-aliasing) in the gasp table.

    The DropOutControlOff specifies at what size and up the dropout control (forces rasterization of lines that would otherwise go right past the pixel centers) turns off. In my case I have it disabled all the way because it can also restrict possibilities of hinting geometrical glyphs or something.

    The CvtCutIn specifies how far the snapping to cvt can go (otherwise it resets to default rounding) starting at each size.

    The ClearTypeCtrl makes various deltas also apply to ClearType rendering that would otherwise get disabled by ClearType hacks. However, as I'm doing full hinting with the deltas optimized for fully hinted rendering, the ClearType hacks are necessary so I have ClearTypeCtrl disabled.

    The LinearAdvanceWidths makes it possible to use fractional ppem sizes in some renderers or something, however as it is impossible to separate deltas of multiple sizes that round to the same ppem I find no use for it in full hinting.

    So I set the first eight cvts to zero because for some reason any attempt to use them glitches the hinting. The 255 is also set to zero because otherwise there would be out of range errors.

    The cvts are for specifying feature sizes that should remain consistent throughout the font. In my case:
    • 8 for the baseline
    • 9 for the x-height
    • 10 for the overshoot baseline
    • 11 for the overshoot x-height
    • 12 for the stem height
    • 13 for the stem width
    • 14 for the cap-height
    • 15 for the ascender-height
    • 16 for the overshoot cap-height
    • 17 for the overshoot ascender-height
    • 18 for the descender-height
    • 19 for the overshoot descender-height
    • 20 for the comma stem width
    • 21 for the dot width and height

    As the character set goes beyond ASCII, more cvts would be necessary. The font top and font bottom for box drawing characters as well as their stem weights come to mind immediately.

    Font hinting instructions include the link, the interpolate and the delta.

    The link: For creating a direct dependence on vertical or horizontal distance from one point to another. It is usually rounded to integer, and may be snapped to a cvt. It may for instance be used for linking from the origin to the baseline or x-height, etc. or for linking one side of a stem to the other. Horizontally it may be used to link from one vertical stem to another.

    The interpolate: For creating a dependence on positioning of a point horizontally or vertically between two points. It may be rounded to integer, but does not use cvt. Example uses are for positioning of a middle horizontal stem in 3569BEGae{} for instance. I've seen examples of interpolating from the bottom and the top but instead I find it the best to interpolate from the tops of two stems to the top of the middle stem, or the bottoms of two stems to the bottom of the middle stem. In case of FPR in place of the bottom of the bottom stem it is possible to use the bottom of the letterform due to the same vertical position, and in H it is possible to create a point within a vertical edge to simulate a top or bottom horizontal stem. @g require multiple interpolations due to multiple middle stems, and $&08Ss involve diagonal middle stems that I find the best to interpolate both ways for top and bottom side with no rounding (similarly the diagonal in the middle of ~ horizontally).

    The delta: There are multiple types of delta available, what they do is at a specific point size they move a single point horizontally or vertically. The types are: the inline delta, which moves the point after the instruction linking to it but before the next instructions depending on it, the pre-IUP delta, which moves the point after the linking and interpolate instructions but before the final interpolation of untouched points (IUP), and the post-IUP delta, which moves the point after the links, interpolates and IUP meaning the delta would not affect any other point whatsoever. The inline delta is generally used to position font features at a different pixel, while the post-IUP delta is generally used to correct pixel patterns.

    There are also other instructions like Shift, Align, Stroke, Move but I haven't used them in hinting, they might be of some use to some hinters out there.
  • Thank you so much for all the information.
    It's the information I need and treasures. It seems that the timing of using each tool will differ depending on the work environment and the desired quality. I'm learning while working.
  • A hinted font would look like something like this:


  • what font is it? looks like Consolas? 
  • Piotr GrochowskiPiotr Grochowski Posts: 91
    edited September 2020
    what font is it? looks like Consolas? 
    It's a development version of DMCA Sans Serif 10.0. https://typedesign.netlify.app/DMCAsansserifv1000dev2.zip (contains Visual TrueType source code)

  • I took a look at the files. The outlines are the same as or modifications of the Consolas font? anyway.... not sure why you are doing that.
  • I took a look at the files. The outlines are the same as or modifications of the Consolas font? anyway.... not sure why you are doing that.
    It can be seen from the outline point arrangement that this is a different digitization than Microsoft Consolas. See https://typedesign.netlify.app/dmcasansserif.html for information on DMCA Sans Serif. I am doing full hinting because full hinting is a fundamental part of a TrueType font.
  • Out of interest why are type designers still working in TrueType given we have OpenType now? I've seen it pop up a few times since browsing TypeDrawers.
  • see discussion on that here 
  • to Piotr , there might be different point placements, but its more or less the same as the Consolas design. odd. 
  • to Piotr , there might be different point placements, but its more or less the same as the Consolas design. odd. 
    Font designs aren't copyrighted, so I was able to use this design in DMCA Sans Serif. Microsoft Consolas is a commercial font so many people do not have legal access to it, and even if they do it could be an outdated version. DMCA Sans Serif is public domain, making it legal to use it for any purpose. Type Design only makes public domain fonts. The ability to make derivative works is a very important part of free fonts, which public domain fonts are. Type Design fonts are my fonts, and they belong to anyone who downloads it as well. The hinting being open-source is very significant as well because it means it is possible for type designers to explore and modify the hinting more easily than with raw TrueType code.
  • Even if this is legal (debatable), it isn't ethical.
  • Piotr GrochowskiPiotr Grochowski Posts: 91
    edited September 2020
    Even if this is legal (debatable), it isn't ethical.
    Since when is public domain unethical? Many type designers get to use and modify the resulting hinting. I consider commercial fonts unethical.
  • Many type designers get to use and modify the resulting hinting

    I think you overestimate the number of type designers interested in touching hinting tools. 
  • Even if this is legal (debatable), it isn't ethical.
    Since when is public domain unethical? Many type designers get to use and modify the resulting hinting. I consider commercial fonts unethical.
    As far as I can tell, copying the glyphs would be unlawful for, generally, at least five years in the United Kingdom, and require royalty payments for the next five - though perhaps they would be zero in this case.

  • Since when is public domain unethical?
    When it pretends there is no protectable creative value in something at the same time as wanting to exploit that value. Consolas didn't exist before Luc did the work of creating it: not just the particular digital representation of the design, but the design itself. The fact that people want to use that design and copy that design is attestation of the creative value of that design. Which is why law that fails to protect typeface design like other creative work is incoherent, and why type design as a professional field mostly operates on the basis of ethical consideration of each other's work, not on jurisdictional legalism.
  • ewalthertewalthert Posts: 5
    Even though this thread derails into legal questions, it seems the most recent vibrant discussion on TrueType hinting.

    It’s 2023 and HiDPI screens seem to be almost the norm. Most type designers design on a Mac and have no conception of how their fonts render on Windows. Every now and then I’m contacted by a panicking designer, having received screenshots of a client on Windows or Linux, that do not look great.

    To my question: does anyone have an estimate about the ratio of screens with device pixel ratios 1, that are still in use worldwide? (72 or 96 dpi)
    I’m able to find percentages of OS use and screen resolutions, but not on 
    device pixel ratios.


  • Aaron BellAaron Bell Posts: 90
    edited July 2023
    "It’s 2023 and HiDPI screens seem to be almost the norm." I think that may be true within certain circles, but likely is not true across globally across a wide swash of users. IMO.
    I'd also be interested in the answer to your question, but I guess my counter-question is, what is the tipping point to you when it is OK *not* to hint?
  • John ButlerJohn Butler Posts: 243
    High-DPI/PPI screens are the norm on nicer phones, tablets and laptops. I do 95% of my work on desktops with 102ppi screens. (30 inch 2560×1600, 20 inch 1200×1600, and 49 inch 3840×2160.) My Windows Display Settings has the font scaling set to “100%.” Normal office users have screens like mine, not Apple 6Ks. Some of the older users I support clutch jealously at their 5:4 ratio 1280×1024 res 19 inch screens. They were born to enjoy well-hinted fonts.
    I also own a little 10 inch 2560×1600 resolution screen, so about 300 DPI, which I use for testing and for odd circumstances. Were I to run Windows in it, I’d probably set it to 200% scaling. It would have less benefit from hinting than my standard 102 ppi screens.
    Fun Fact: if you run a 13 or 14 inch laptop with a 1920×1080 res screen, you can get the same size pixels on a 27 or 28 inch 4K monitor. If you run a 15.6 inch laptop at that resolution, the nearest matching pixel sizes can be found on a 31.5 inch 4K monitor.
  • Thomas PhinneyThomas Phinney Posts: 2,732
    As Aaron implies: there are billions of people with much cheaper devices and lower resolutions in Asia and Africa. (Plus, Eastern Europe and South America are more-or-less in between Africa/Asia and the rest of the West.)
  • ewalthertewalthert Posts: 5
    Thanks for the answers, I was hoping to see your comments here. The billions of people was also my suspicion, but it is difficult to argue, when we don't have any actual data. 

    I’m all pro TT-hinting and I’m putting in a lot of effort and time in doing the best I can. Even on HiDPI screens, hinting is still improving the rendering of most fonts.
  • John HudsonJohn Hudson Posts: 2,955
    It may be worth noting that TT hinting is not one thing or one approach, but a set of tools that can be used in a number of different ways to affect rendering across a wide range of resolutions and rendering techniques. The kind of intensive hinting we used to do for b/w pixel rendering and early greyscale antialisaing on lower resolution devices is pretty much completely obsolete, because even lower resolution devices are now using more sophisticated antialiasing techniques and b/w bitmap displays are very rare. Since the early 2000s, we’ve shifted towards a much less intensive hinting model, mostly focused on y-direction alignment control, sometimes with no x-direction hints at all, relying on higher resolutions and subpixel antialiasing to look after that aspect of rendering. We’ve also made fonts for some scripts, notably cascading Arabic, in which we rely almost entirely on font-level half-grid fitting and dispensed with glyph level hints as being unhelpful.

    The kinds of lighter, y-direction hinting that we use most often now are well-suited to automation, which is just as well because hinting budgets have disappeared from most projects that we work on now.
  • ewalthertewalthert Posts: 5

    Hi John, thanks for your elaborate answer. I do agree, that autohinting can often be enough, if one understands the tools and prepares the fonts well before running the autohinter. 

    Unfortunately I observed that the claim “autohinting is good enough” leads to some designers not preparing, nor controlling their fonts and just checking the autohint box during export. Which can lead to worse results than unhinted fonts.

Sign In or Register to comment.