folkertdev/elm-cff/1.0.0

Dict.Top

The top-level dictionaries of all fonts in the file.

type alias Top =
{ version : Maybe Int
, notice : Maybe Int
, copyright : Maybe Int
, full_name : Maybe Int
, family_name : Maybe Int
, weight : Maybe Int
, is_fixed_pitch : Bool
, italic_angle : Int
, underline_position : Int
, underline_thickness : Int
, paint_type : Int
, charstring_type : Int
, font_matrix : FontMatrix
, unique_id : Maybe Int
, font_bounding_box : FontBoundingBox
, stroke_width : Int
, xuid : Maybe (List Argument)
, charset : Int
, encoding : Int
, charstrings : Maybe Int
, private :
Maybe
{ size : Int
, offset : Int
}
, synthetic_base : Maybe Int
, post_script : Maybe Int
, base_font_name : Maybe Int
, base_font_blend : Maybe (List Argument)
, cid : Maybe Cid
}

The TOP dict

type alias Cid =
{ ros : ( Int, Int, Int )
, font_version : Float
, font_revision : Float
, font_type : Int
, count : Int
, uid_base : Maybe Int
, fd_array : Int
, fd_select : Int
, font_name : Maybe Int
}

Additional operators used in CIDFonts

decode : Int -> Decoder Top

Decode the top dict given its size (in bytes)

type alias Point =
{ x : Int
, y : Int
}

A 2d point

type alias FontBoundingBox =
{ bottomLeft : Point
, topRight : Point
}

The font bounding box

type alias FontMatrix =
{ a : Float
, b : Float
, c : Float
, d : Float
, e : Float
, f : Float
}

The font matrix