You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the instructions for converting a font to SVG for the Hasklig font, specifically Hasklig-Regular.otf that was part of the 1.1 release downloadable from here.
The method worked well but, alas, there were no ligature effects. Code to reproduce:
import qualified Data.Text.Lazy.IO as Text
import Graphics.Text
import Diagrams.Backend.SVG
import qualified Diagrams.Prelude as D
import Graphics.SVGFonts
toSvg = D.renderDia SVG (SVGOptions (D.mkSizeSpec (D.V2 (Just 600) (Just 400))) Nothing "id" [] True)
toFile f = Text.writeFile f . prettyText
toDia f = textSVG_ (TextOpts f INSIDE_H KERN False 0.1 0.1)
main = do
font <- loadFont "other/Hasklig-Regular.svg"
toFile "example.svg" . toSvg . toDia font $ "0123 <* <*> <$> <| |> <|> <> <- -> => >>= =<< :: ++ /= =="
Any thoughts?
Tony
The text was updated successfully, but these errors were encountered:
When converting to an SVG font, FontForge doesn't include glyphs that are constructed using code. For example, if the font constructs ligatures by assembling them from shared fragments, they won't show up in the SVG font. You'll only get ligatures that are fully specified with their own outline graphics. I'm guessing that's what happened here.
However, you do get all the fragments. They appear in the SVG font as glyphs that are not bound to any Unicode sequence. Perhaps you can figure out how to assemble them yourself using diagrams code.
I followed the instructions for converting a font to SVG for the Hasklig font, specifically Hasklig-Regular.otf that was part of the 1.1 release downloadable from here.
The method worked well but, alas, there were no ligature effects. Code to reproduce:
Any thoughts?
Tony
The text was updated successfully, but these errors were encountered: