module Graphics.SVGFonts.Fonts
       ( -- * Built-in fonts
         bit, lin, lin2, loadDataFont
       ) where

import Graphics.SVGFonts.ReadFont (loadFont, PreparedFont)
import Paths_SVGFonts (getDataFileName)

-- | Get full path of data file.
-- Safe if package is installed correctly.
dataFile :: FilePath -> IO FilePath
dataFile :: FilePath -> IO FilePath
dataFile = FilePath -> IO FilePath
getDataFileName

-- | Load a font from a file in the data directory.
loadDataFont :: (Read n, RealFloat n) =>
                FilePath -> IO (PreparedFont n)
loadDataFont :: FilePath -> IO (PreparedFont n)
loadDataFont FilePath
filepath =
  do FilePath
f <- FilePath -> IO FilePath
dataFile FilePath
filepath
     FilePath -> IO (PreparedFont n)
forall n. (Read n, RealFloat n) => FilePath -> IO (PreparedFont n)
loadFont FilePath
f

-- | Bitstream, a standard monospaced font (used in gedit)
bit :: (Read n, RealFloat n) => IO (PreparedFont n)
bit :: IO (PreparedFont n)
bit = FilePath -> IO (PreparedFont n)
forall n. (Read n, RealFloat n) => FilePath -> IO (PreparedFont n)
loadDataFont FilePath
"fonts/Bitstream.svg"

-- | Linux Libertine, for non-monospaced text.
--   <http://www.linuxlibertine.org/>
--   Contains a lot of unicode characters.
lin :: (Read n, RealFloat n) => IO (PreparedFont n)
lin :: IO (PreparedFont n)
lin = FilePath -> IO (PreparedFont n)
forall n. (Read n, RealFloat n) => FilePath -> IO (PreparedFont n)
loadDataFont FilePath
"fonts/LinLibertine.svg"

-- | Linux Libertine, cut to contain only the most common characters.
--   This results in a smaller file and hence a quicker load time.
lin2 :: (Read n, RealFloat n) => IO (PreparedFont n)
lin2 :: IO (PreparedFont n)
lin2 = FilePath -> IO (PreparedFont n)
forall n. (Read n, RealFloat n) => FilePath -> IO (PreparedFont n)
loadDataFont FilePath
"fonts/LinLibertineCut.svg"