module Wumpus.Basic.FontLoader.AfmLoader
(
module Wumpus.Basic.FontLoader.Base
, module Wumpus.Basic.FontLoader.AfmV4Dot1Parser
, loadAfmMetrics
, afmV4Dot1Loader
) where
import Wumpus.Basic.FontLoader.AfmV4Dot1Parser
import Wumpus.Basic.FontLoader.Base
import Wumpus.Basic.Graphic
import Wumpus.Core
loadAfmMetrics :: FilePath -> [FontName] -> IO BaseGlyphMetrics
loadAfmMetrics font_dir_path ns =
loadBaseGlyphMetrics (afmV4Dot1Loader font_dir_path) ns
afmV4Dot1Loader :: FilePath -> FontLoader AfmUnit
afmV4Dot1Loader font_dir_path =
FontLoader
{ unit_scale_fun = afmUnitScale
, path_to_font_dir = font_dir_path
, file_name_locator = buildName
, font_parser = parseAfmV4Dot1File
, post_process = buildGlyphMetricsTable bbox (V2 600 0) 1000
}
where
buildName :: FontName -> FilePath
buildName font = font ++ ".afm"
bbox = BBox (P2 (23) (250)) (P2 715 805)