From e22263816e85f9808d88aafb13ea5f8a7025218e Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 2 Oct 2014 23:29:01 +0200 Subject: [PATCH] Update docs and front-ends to the extended one-point segment syntax. --- doc/ttfautohint-1.pandoc | 32 +++++++++++++++++++++----------- frontend/main.cpp | 11 +++++++---- frontend/maingui.cpp | 17 +++++++++++++---- 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/doc/ttfautohint-1.pandoc b/doc/ttfautohint-1.pandoc index 2fe0c5e..6b7e00d 100644 --- a/doc/ttfautohint-1.pandoc +++ b/doc/ttfautohint-1.pandoc @@ -509,7 +509,8 @@ bytecode larger. An entry in a control instructions file has one of the following syntax forms: - > *\[* font-idx *\]*\ \ glyph-id\ \ *`l`|`r`|`n`* points\ + > *\[* font-idx *\]*\ \ glyph-id\ \ *`l`|`r`* points\ \ *\[* *`(`* left-offset *`,`* right-offset *`)`* *\]*\ + > *\[* font-idx *\]*\ \ glyph-id\ \ *`n`* points\ > *\[* font-idx *\]*\ \ glyph-id\ \ *`p`* points\ \ *\[* *`x`* x-shift *\]*\ \ *\[* *`y`* y-shift *\]*\ \ *`@`* ppems *font-idx* gives the index of the font in a TrueType Collection. If @@ -525,17 +526,26 @@ bytecode larger. specified in decimal, octal, or hexadecimal format, the latter two indicated by the prefixes `0` and `0x`, respectively. - The mutually exclusive parameters '`l`', '`r`', or\ '`n`' indicate that - the following points have left, right, or no direction, respectively, + The mutually exclusive parameters '`l`' and '`r`' indicate that the + following points have left or right 'out' direction, respectively, overriding ttfautohint's algorithm for setting point directions. The - 'direction of a point' is the direction of the outline controlled by - this point. By changing a point's direction from 'no direction' to - either left or right, you can create a one-point segment with the given - direction so that ttfautohint handles the point similar to other - segments. Setting a point's direction to 'no direction', ttfautohint no - longer considers it as part of a segment, thus treating it as a 'weak' - point. Changed point directions don't directly modify the outlines; - they only influence the hinting process. + 'out direction' of a point is the direction of the outline *leaving* the + point (or passing the control point). If the specified direction is + identical to what ttfautohint computes, nothing special happens. + Otherwise, a one-point segment with the specified direction gets + created. By default, its length is zero. Setting *left-offset* and + *right-offset*, you can change the segment's horizontal start and end + position relative to the point position. *left-offset* and + *right-offset* are integers measured in font units. + + Parameter '`n`' sets the 'out' direction of the following points to 'no + direction'. If the specified direction is identical to what ttfautohint + computes, nothing special happens. Otherwise, ttfautohint no longer + considers those points as part of horizontal segments, thus treating + them as 'weak' points. + + Modifying or adding segments don't directly modify the outlines; it only + influences the hinting process. Parameter '`p`' makes ttfautohint apply delta exceptions for the given points, shifting the points by the given values. Note that those delta diff --git a/frontend/main.cpp b/frontend/main.cpp index c73a420..35581cd 100644 --- a/frontend/main.cpp +++ b/frontend/main.cpp @@ -412,13 +412,16 @@ show_help(bool "\n" "A control instructions file contains entries of the form\n" "\n" -" [] l|r|n \n" -"\n" +" [] l|r [(,)]\n" +"or\n" +" [] n \n" "or\n" -"\n" " [] p [x ] [y ] @ \n" "\n" -"`l' (`r', `n') changes point directions to left (right, no direction).\n" +"`l' (`r') creates one-point segments with direction left (right).\n" +" and specify offsets (in font units)\n" +"relative to the corresponding points to give the segments a length.\n" +"`n' removes points from horizontal segments, making them `weak' points.\n" "`p' applies delta exceptions to the specified points.\n" "\n" " is a glyph name or index, is a real number in px,\n" diff --git a/frontend/maingui.cpp b/frontend/maingui.cpp index 2dcac3f..7470ad6 100644 --- a/frontend/maingui.cpp +++ b/frontend/maingui.cpp @@ -1196,7 +1196,12 @@ Main_GUI::create_layout(bool horizontal_layout) " 
" "  [ subfont-idx ]" "  glyph-id" - "  l|r|n points
" + "  l|r points" + "  [ (left-offset," + "right-offset) ]
" + "  [ subfont-idx ]" + "  glyph-id" + "  n points
" "  [ subfont-idx ]" "  glyph-id" "  p points" @@ -1206,8 +1211,12 @@ Main_GUI::create_layout(bool horizontal_layout) " 
" "subfont-idx gives the subfont index in a TTC," " glyph-id is a glyph name or index.
" - "l (r, n) force point directions" - " to be left (right, no direction).
" + "l (r) creates one-point segments with direction" + " left (right), possibly having a width (in font units)" + " given by left-offset and right-offset" + " relative to the corresponding points.
" + "n removes points from horizontal segments," + " making them weak points.
" "p defines delta exceptions" " (to be applied after the final" " IP bytecode instructions;" @@ -1224,7 +1233,7 @@ Main_GUI::create_layout(bool horizontal_layout) " Empty lines are ignored, too.

" "" "Examples:
" - "  Q l 38
" + "  Q l 38 (-70,20)
" "  Adieresis p 3-6 y 0.25 @ 13")); control_line->setCompleter(completer); -- 2.11.4.GIT