Is there any tool you can use to look at the final ordering the glyphs after shaping Engine has done

WAY KYI
WAY KYI Posts: 130
I am trying to check to see the final ordering of the glyphs after the shaping engine has done its job. 
I am trying to get exact ordering in Unicode numbers, so that I will know how I can write opentype
features based on final result of glyph ordering. 
Tagged:

Comments

  • Simon Cozens
    Simon Cozens Posts: 732
    edited June 2022
    This may help: http://corvelsoftware.co.uk/crowbar/
    Note that reordering is performed by the shaper after the codepoints have been mapped to glyphs (although the shaper internally remembers the initial codepoints). So the reordering will appear in terms of glyphs, not Unicode codepoints. For example:


    Here you can see that the shaping engine first took a buffer of codepoints, then mapped them to glyph, then performed initial Indic reordering on those glyphs (placing the evowelsign at the beginning of the cluster). Next it executed the lookups in the half-form feature, before doing final reordering (which on this string didn't do anything).
  • WAY KYI
    WAY KYI Posts: 130
    This is very resourceful and very helpful. Thank you very much.
  • There is also FontGoggles for macOS:

    And if you have Windows, you can use FontCreator as it includes font proofing within the OpenType Designer:





    It uses our own shaping engine, but the main benefit is that you can inspect and edit your OpenType layout features within the same software.

    This tutorial explains all advanced proofing options:


  • Simon Cozens
    Simon Cozens Posts: 732
    I would really love to have a similar step-by-step debugger for DirectWrite, because there are sometimes some unexpected differences between that and other engines. (Crowbar uses Harfbuzz.) I don't know if VOLT would include such a thing, or if MS would need to add callbacks into DWrite to make it happen.
  • John Hudson
    John Hudson Posts: 3,126
    I don't know if VOLT would include such a thing
    No. VOLT doesn’t use a shaping engine at all: the output in its proofing tool is pure lookup processing or, to put it another way, the VOLT user is the shaping engine and in order to test lookups for scripts that involve reordering one needs to know what the order of glyphs will be at the stage when the lookups are applied, and use that as input for the proofing tool. That useful for debugging lookups, but does mean of course that the user needs to learn to think like a shaping engine. There has been talk over the years of how nice it would be to also have access to one or more shaping engines within VOLT, but the ancient Visual Basic (!) codebase makes that unlikely.

    I agree that a DWrite step-by-step debugger would be a great thing to have. I presume Microsoft has one that they use internally, but I am not aware of it ever being made available to anyone else. Mind you, I never asked for it...
  • In addition (and for the sake of completeness), OTM might also be useful in this case in some way.
    DTL OTMaster
  • BabelPad is Windows only and will show the input codepoints that make up the final output.





  • John Hudson
    John Hudson Posts: 3,126
    OTM might also be useful in this case in some way.

    The OTM Text Viewer tool is quite useful for examining the interaction of individual layout features with the shaping engine, but it doesn’t provide the kind of information @WAY KYI is seeking about glyph order. Also, it can be misleading because it doesn’t graphically indicate the presence of mark glyphs or provide any way to interact with them to identify them. So, for example, in this case the rectangular boxes suggest that there are two glyphs present, when in fact there are three.

  • Peter Constable
    Peter Constable Posts: 206
    edited June 2022
    I would really love to have a similar step-by-step debugger for DirectWrite, because there are sometimes some unexpected differences between that and other engines. (Crowbar uses Harfbuzz.) I don't know if VOLT would include such a thing, or if MS would need to add callbacks into DWrite to make it happen.
    IDWriteTextAnalyzer::GetGlyphs will give the shaping result (GSUB processing and glyph re-ordering). But you want something that shows steps along the way?

    What would the steps be? Each time the shaper has either re-ordered or processed features that results in some change to the glyph sequence?
  • Peter Constable said:
    What would the steps be?
    Simons tool Crowbar shows the intermediate steps. The same can be done with `hb-shape --trace FONT STRING` on the command line or in the Trace Viewer of the Hibizcus Mac app.
  • Simon Cozens
    Simon Cozens Posts: 732
    What would the steps be? Each time the shaper has either re-ordered or processed features that results in some change to the glyph sequence?
    Right. Harfbuzz can log the buffer contents at each lookup application or internal reordering.
  • John Hudson
    John Hudson Posts: 3,126
    What would the steps be? Each time the shaper has either re-ordered or processed features that results in some change to the glyph sequence?

    For font debugging, one wants to know what has caused the change in the glyph sequence (whether by substitution or positioning), the steps need to be at the lookup level. Basically, one wants something like the VOLT proofing tool, in which it is possible to step through the string lookup-by-lookup and glyph-by-glyph, but with shaping engine support so that character-level operations and reordering outcomes are also analysable step-by-step. So this would start with things like buffered character composition of base+combining mark cmap lookups, and initial reordering for those script shaping engines that perform it, then the GSUB, with final reordering occuring at the appropriate point.

    A complexity of this is that some fonts might have lookup order that the shaping engine overrides in the processing blocks, so stepping through the lookups in the order in which they appear in the GSUB table might not correspond to the processing that is actually being applied by the shaping engine with regard to glyph ordering. @Simon Cozens, how do you handle that sort of thing in Crowbar?
  • Simon Cozens
    Simon Cozens Posts: 732
    Crowbar uses the Harfbuzz logging, i.e. it is directly being told by the shaping engine about each lookup that is processed in turn. (Basically it is just a pretty wrapper around "hb-shape -V")
  • WAY KYI
    WAY KYI Posts: 130
    Wow ... I love you all. There seem to be lot of tools for what I am looking for. But I like Crowbar. Because it shows what Shaping Engine did and what Opentype features are used along the process and their result. This is the kind of information I am looking for. I use Fontforge - Free & clean UI but good enough for me. Thank you everyone!!!
  • RichardW
    RichardW Posts: 100
    Does anyone know why late Windows 10 Character Map and Notepad render differently?