~alcinnz/fontconfig-pure

ref: 1d62f0618dc5890364fdfce8a0277a1f0062337c fontconfig-pure/Main.hs -rw-r--r-- 768 bytes
1d62f061 — Adrian Cochrane Bind FontConfig 'size' to CSS 'font-size', ensure old values get overriden. 2 years ago
                                                                                
a327c852 Adrian Cochrane
e21707cb Adrian Cochrane
a327c852 Adrian Cochrane
c10cdcf2 Adrian Cochrane
a327c852 Adrian Cochrane
e21707cb Adrian Cochrane
a327c852 Adrian Cochrane
c10cdcf2 Adrian Cochrane
cc3a295f Adrian Cochrane
a327c852 Adrian Cochrane
c10cdcf2 Adrian Cochrane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{-# LANGUAGE PackageImports #-}
module Main where

import "fontconfig-pure" Graphics.Text.Font.Choose as Font

import System.Environment (getArgs)
import Control.Monad (forM)

main :: IO ()
main = do
    args <- getArgs
    let (all, name, objects) = case args of {
        [] -> (False, "serif", []);
        "!":name:objects -> (True, name, objects);
        name:objects -> (False, name, objects)}
    let query = nameParse name
    print query
    let query' = defaultSubstitute $ configSubstitute' query MatchPattern
    print query'

    case fontSort' query' all of
        Just (res, charset) -> do
            print charset
            forM res $ \res' -> print $ fontRenderPrepare' query' res'
            return ()
        Nothing -> putStrLn "No results!"