A new graphical editor for TrueType hints

Options
13»

Comments

  • Peter Baker
    Peter Baker Posts: 182
    edited February 20
    Options
    I have done a whole lot less testing with x-hints than with y-hints: I think there may be some glitches when changing back and forth between x and y. I'm going to open an issue in the GitHub repo: you can track it there.
    FFTM is a non-standard table generated by FontForge. The message is saying that the FontTools subsetter doesn't know how to handle it and so is dropping it. The table apparently contains timestamps, and dropping it is harmless. See here.
  • Peter Baker
    Peter Baker Posts: 182
    edited February 20
    Options
    Your x code starts like this (I've substituted point indices for coordinates for intelligibility):
    - ptid: 0
    - ptid: 9
      rel: blackdist
    This is a problem because point 9 is governed by a distance-type hint (MIRP or MDRP), but it lacks the required reference point (distance from what?). The GUI isn't supposed to produce code like this (I included all the safeguards against it that I could think of), so I don't know what happened. The program is looking for that reference point, not finding it ("None"), and substituting 0 as a better choice than crashing.
    This works:
    
    - ptid: 0
      points:
      - ptid 9
        rel: blackdist
    Now the reference point for the distance hint is implicitly 0, and it works without error.
  • pthomas505
    Options
    I seem to be getting the same error if the glyph yaml code looks like this:

      A:
        x:
          points:
          - ptid: 0
            points:
            - ptid: 9
              rel: blackdist

    I think the code I attached must have been from saving it after the error occurred.

    The actions I am taking to reproduce this are:

    1. Open ygt.
    2. Open the TTF file in ygt.
    3. Select horizontal hinting.
    4. Put an anchor at the bottom left point (point 0).
    5. Put a stem from that anchored point to the adjacent horizontal point (point 9).
    6. Save the yaml file.
    7. Quit ygt.
    8. Open ygt.
    9. Select horizontal hinting.

    The console then prints "Warning: ref is None (target is 9)" and a dialog box displays "Failed to resolve point identifier None in glyph A. Substituting zero.".
  • pthomas505
    Options
    I forgot a step after step 8: Open the saved yaml file.
  • Peter Baker
    Options
    Okay, I think I understand what's going on. I'll report when it's fixed.
  • pthomas505
    Options
    Ok. Thank you!
  • Peter Baker
    Options
    Version 0.2.5 (just posted) adds a monochrome rendering mode for the preview panels and fixes the bugs we've discussed.
  • pthomas505
    Options
    Thank you!

    If I now make a hint in the horizontal direction, but no hint in the vertical direction, and then attempt to save it, I get the following:

    Traceback (most recent call last):
      File "ygt/window.py", line 1213, in save_as
      File "ygt/ygModel.py", line 2828, in cleanup_glyph
      File "ygt/ygModel.py", line 772, in has_hints
    KeyError: 'y'
    Aborted (core dumped)

    If I add a hint in the vertical direction before I save it, then this error does not occur.
  • Peter Baker
    Options
    Thanks, I will fix. In the meantime, hint on the y axis first!

  • pthomas505
    Options
    Will do :)

    Would it be possible to add a method to select points to be used as input to macros defined in xgridfit or something similar? I would like to add hints for the diagonals like I have here: https://github.com/pthomas505/fonts/tree/main/fonts/family_name/monospace/size1/design_2/ttf/hinting/xgridfit and see the results in the preview pane with those of the horizontal and vertical hints.

  • Peter Baker
    Options
    I'm not sure I understand what you're asking. Something in the UI? What would it look like?
  • pthomas505
    Options
    I'm not sure if I am doing something wrong, but for some reason the including of one xgridfit file in another does not seem to be working for me with xgridfit 3.2.12 and the files in that directory when I run "xgridfit -i ../../Untitled.ttf -o ../../Untitled-hinted.ttf font.xgf".
  • Peter Baker
    Options
    I've put a working .yaml file in the example directory of the ygt repo: I'll remove it when you indicate that you've got it. You can read about how to apply a macro or function in YGT-intro.pdf (starting p. 20). It's awkward, but it works.

    As for xinclude, it's always been a pain, not well supported by XML processors, and I recommend avoiding it.

  • pthomas505
    Options
    I'm sorry, I don't see a new yaml file. What is the url?
  • Peter Baker
    Peter Baker Posts: 182
    edited February 24
    Options
    Sorry, it was late at night and I forgot to punch the "commit" button. You'll find it in the repo now.
    When another problem comes up, please open an issue in the repository.
  • pthomas505
    Options
    Got it. Thank you.