LBearing & RBearing in zero-width glyph

Why the measurements of LBearing & RBearing in zero-width glyph are different in Fontforge??
Or is this the same for all font creating software?
LB have negative number while RB has positive number in measurements.
Both points ( left & right most ) are in negative territory of horizontal baseline.
Can someone explain me why and how these are measured? Thanks


Tagged:

Comments

  • John HudsonJohn Hudson Posts: 2,946
    This should be up to the designer. Sometimes, it is helpful to have the outlines of a zero-with glyph offset to the left (or to the right in a right-to-left script) so that it automatically sits under/over a preceding base glyph, either because this is adequate without anchor attachment (as in the case of many Kannada subscripts) or because this means that in many cases the anchor can be defined on the base relative to its right sidebearing (as in a lot of Devanagari letters).

    At other times, a designer may want to optically centre the outline on the zero-width, such that the mark anchor sits on that zero-width.

  • WAY KYIWAY KYI Posts: 128
    Thanks a lot for your explanations. So, let me make sure I understand you correctly - you mean a zero-width glyph offset to the left is negative number ( left to right script ) and positive for RB? I was confused because both of L/R points of outline are on the left side of original point (0,0) and mathematically they are in negative numbers.

    And if you don't place the zero-width glyph( below base ) in the right place you can use mark to Base ( GPOS ) anchor point to position the glyph under preceding glyph, right?. In your image, is "center" is the anchor point of zero-width glyph ( seem like above base )??? Thanks
  • John HudsonJohn Hudson Posts: 2,946
    Thanks a lot for your explanations. So, let me make sure I understand you correctly - you mean a zero-width glyph offset to the left is negative number ( left to right script ) and positive for RB? I was confused because both of L/R points of outline are on the left side of original point (0,0) and mathematically they are in negative numbers.
    Correct. Any coordinate to the left of the 0,0 is a negative x value, and any coordinate to the right is a positive x value. [The ‘right side bearing’ of a glyph is a glyph editing tool calculated distance; font formats actually store only left side bearing and advance width.]

    And if you don't place the zero-width glyph( below base ) in the right place you can use mark to Base ( GPOS ) anchor point to position the glyph under preceding glyph, right?. In your image, is "center" is the anchor point of zero-width glyph ( seem like above base )??? Thanks
    Ignore that _center anchor. It is an artifact in that master layer that I didn’t spot and remove before making the screenshot. The actual anchor used with this mark is the _top one, which you note is aligned to the (diagonal: this is from an italic font) zero-width. Using this kind of anchor alignment, one then optically positions the outline across the zero-width in the way one wants it to be aligned relative to base letters with the top anchor.

    [Note, I am using FontLab 7, so am not sure how these comments relate to how FontForge handles anchors.]

    _____

    Technically, if one is relying on anchors—either within the font tool to build composites or in layout via OpenType Layout GPOS anchor attachment positioning—the position of the anchor relative to the 0,0 coordinate of the glyph space is irrelevant: so long as the anchor position relative to the outline is where you want it to be for mark positioning purposes, it can be arbitrarily placed relative to 0,0.

    That said, I greatly prefer to keep things tidy, and to have the mark anchor in a consistent x position relative to 0,0 across all combining mark glyphs. This means either on the zero-width, or offset a common distance to the left or right depending on script direction.

  • WAY KYIWAY KYI Posts: 128

    wait, is my logic correct? The space to the left of Left edge of the outline is positive and to the right is negative. But the space to the right of right edge is positive and left is negative. I played the mouse dragging the RBearing line to the left and the numbers changes to negative when it passes the right edge of the outline. How do you think?
  • WAY KYIWAY KYI Posts: 128
     [The ‘right side bearing’ of a glyph is a glyph editing tool calculated distance; font formats actually store only left side bearing and advance width.]

    This well explained it for me, thank you very much.
  • John HudsonJohn Hudson Posts: 2,946
    edited May 2022
    The space to the left of Left edge of the outline is positive and to the right is negative.
    To clarify, when I say outline, I mean the visible glyph shape, not its horizontal spacing metrics as defined by its sidebearings.

    All coordinates in glyph space are relative to 0,0 and positive values are right and up, and negative values are left and down. That is regardless of the writing direction of the script for which the glyph is designed, so is as true for Arabic glyphs and for Latin ones.

    Sidebearing values in editing tools tend to be defined relative to the outline, so if the outline is within the sidebearings the values will be positive, and if either outline edge extends beyond its sidebearing, then that value will be negative.

  • WAY KYIWAY KYI Posts: 128
    Thank you so much. Seem like in Fontforge LSB line is set at x=0 ( can't set at any other point ) and other Font Apps have LSB can be set at any point along the x-line. So, in zero-width glyph - both LSB and RSB lines are at x=0. Thus negative number for LSB value ( out of sidebearings ) and positive number for RSB value ( inside RSB line ). Hope this is correct understanding as per your last comment. Thanks
  • John HudsonJohn Hudson Posts: 2,946
    Thank you so much. Seem like in Fontforge LSB line is set at x=0 ( can't set at any other point ) and other Font Apps have LSB can be set at any point along the x-line. 
    By definition, wherever the left sidebearing is set is x=0.

Sign In or Register to comment.