go-text / typesetting

High quality text shaping in pure Go.
Other
101 stars 10 forks source link

[fontscan] Provide precise Location in FontMap.AddFace #112

Closed benoitkugler closed 9 months ago

benoitkugler commented 10 months ago

I use FontMap.AddFace to have control about the description registered with a font, but I would also control the file identifier. That is, I would like to also pass a Location. For now, the package generate a synthetic file name with out.Location.File = fmt.Sprintf("%v", md) (md being the font description provided by the caller).

Would you be OK to change the signature to AddFace(face font.Face, id Location, md meta.Description) ?

The previous behavior could be easily obtained with AddFace(face font.Face, Location{File: fmt.Sprintf("%v", md)}, md meta.Description)

Pinging @whereswaldon as code author

whereswaldon commented 10 months ago

I have no objection; do it!