Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong rendering of "87" with FreeSans font #31

Open
ygale opened this issue Dec 8, 2019 · 0 comments
Open

Wrong rendering of "87" with FreeSans font #31

ygale opened this issue Dec 8, 2019 · 0 comments

Comments

@ygale
Copy link

ygale commented Dec 8, 2019

After converting FreeSans to SVG using FontForge, the string "87" is rendered incorrectly by SVGFonts. FreeSans is a large font, but I cut it down to a minimal repro font with only 3 glyphs. In particular, I removed all kerning and it still reproduces, so this is not the same as #29.

In the following code, if you uncomment either the "FreeSans" line or the "font87bad" line, the text renders incorrectly. If you uncomment the "font87good" line (that font has only the two glyphs '7' and '8'), the text renders correctly. The fonts are attached, but I renamed them from .svg to .txt to make Github happy.

import Diagrams.Backend.SVG.CmdLine
import Diagrams.Prelude
import Graphics.SVGFonts

main = do
   --font <- loadFont "FreeSans.svg"
   font <- loadFont "font87bad.svg"
   --font <- loadFont "font87good.svg"
   let txt t =
         (stroke (textSVG' (TextOpts font INSIDE_H KERN False 10 10) t)
          :: Diagram B) # fillRule EvenOdd # fc black
   mainWith $ txt "8877"

font87bad.txt
font87good.txt
FreeSans.txt.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant