golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.14k stars 17.69k forks source link

x/image/font: the term 'dot' in the comments is confusing #60501

Open hajimehoshi opened 1 year ago

hajimehoshi commented 1 year ago

In the comments of the x/image/font package, the term 'dot' is used as the origin position of rendering. I thought the 'dot' indicated the position of the glyph of the period . (e.g. the center of the period glyph would be (0, 0)), but actually this was not with most fonts. Apparently, the dot indicates the origin position in this figure: https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Art/glyphterms_2x.png Is the 'dot' a usual term for typography? If not, I hope the comments would be updated to clarify the things.

/CC @nigeltao

tinne26 commented 1 year ago

From https://freetype.org/freetype2/docs/glyphs/glyphs-3.html, which is probably one of the best references on the topic available on the web:

Moreover, to render text, a virtual point, located on the baseline, called the pen position or origin, is used to locate glyphs.