diff options
Diffstat (limited to 'src/Graphics/Fountainhead/TrueType.hs')
| -rw-r--r-- | src/Graphics/Fountainhead/TrueType.hs | 141 |
1 files changed, 138 insertions, 3 deletions
diff --git a/src/Graphics/Fountainhead/TrueType.hs b/src/Graphics/Fountainhead/TrueType.hs index 86aeb5f..2fff036 100644 --- a/src/Graphics/Fountainhead/TrueType.hs +++ b/src/Graphics/Fountainhead/TrueType.hs @@ -1007,7 +1007,62 @@ data BLetterform | ObliqueRoundedLetterform | ObliqueOffCenterLetterform | ObliqueSquareLetterform - deriving (Eq, Show) + deriving Eq + +instance Show BLetterform + where + show AnyLetterform = "Any" + show NoFitLetterform = "No Fit" + show NormalContactLetterform = "Normal/Contact" + show NormalWeightedLetterform = "Normal/Weighted" + show NormalBoxedLetterform = "Normal/Boxed" + show NormalFlattenedLetterform = "Normal/Flattened" + show NormalRoundedLetterform = "Normal/Rounded" + show NormalOffCenterLetterform = "Normal/Off Center" + show NormalSquareLetterform = "Normal/Square" + show ObliqueContactLetterform = "Oblique/Contact" + show ObliqueWeightedLetterform = "Oblique/Weighted" + show ObliqueBoxedLetterform = "Oblique/Boxed" + show ObliqueFlattenedLetterform = "Oblique/Flattened" + show ObliqueRoundedLetterform = "Oblique/Rounded" + show ObliqueOffCenterLetterform = "Oblique/Off Center" + show ObliqueSquareLetterform = "Oblique/Square" + +instance Enum BLetterform + where + fromEnum AnyLetterform = 0 + fromEnum NoFitLetterform = 1 + fromEnum NormalContactLetterform = 2 + fromEnum NormalWeightedLetterform = 3 + fromEnum NormalBoxedLetterform = 4 + fromEnum NormalFlattenedLetterform = 5 + fromEnum NormalRoundedLetterform = 6 + fromEnum NormalOffCenterLetterform = 7 + fromEnum NormalSquareLetterform = 8 + fromEnum ObliqueContactLetterform = 9 + fromEnum ObliqueWeightedLetterform = 10 + fromEnum ObliqueBoxedLetterform = 11 + fromEnum ObliqueFlattenedLetterform = 12 + fromEnum ObliqueRoundedLetterform = 13 + fromEnum ObliqueOffCenterLetterform = 14 + fromEnum ObliqueSquareLetterform = 15 + toEnum 0 = AnyLetterform + toEnum 1 = NoFitLetterform + toEnum 2 = NormalContactLetterform + toEnum 3 = NormalWeightedLetterform + toEnum 4 = NormalBoxedLetterform + toEnum 5 = NormalFlattenedLetterform + toEnum 6 = NormalRoundedLetterform + toEnum 7 = NormalOffCenterLetterform + toEnum 8 = NormalSquareLetterform + toEnum 9 = ObliqueContactLetterform + toEnum 10 = ObliqueWeightedLetterform + toEnum 11 = ObliqueBoxedLetterform + toEnum 12 = ObliqueFlattenedLetterform + toEnum 13 = ObliqueRoundedLetterform + toEnum 14 = ObliqueOffCenterLetterform + toEnum 15 = ObliqueSquareLetterform + toEnum _ = error "Unknown letterform" data BMidline = AnyMidline @@ -1024,7 +1079,56 @@ data BMidline | LowTrimmedMidline | LowPointedMidline | LowSerifedMidline - deriving (Eq, Show) + deriving Eq + +instance Show BMidline + where + show AnyMidline = "Any" + show NoFitMidline = "No Fit" + show StandardTrimmedMidline = "Standard/Trimmed" + show StandardPointedMidline = "Standard/Pointed" + show StandardSerifedMidline = "Standard/Serifed" + show HighTrimmedMidline = "High/Trimmed" + show HighPointedMidline = "High/Pointed" + show HighSerifedMidline = "High/Serifed" + show ConstantTrimmedMidline = "Constant/Trimmed" + show ConstantPointedMidline = "Constant/Pointed" + show ConstantSerifedMidline = "Constant/Serifed" + show LowTrimmedMidline = "Low/Trimmed" + show LowPointedMidline = "Low/Pointed" + show LowSerifedMidline = "Low/Serifed" + +instance Enum BMidline + where + fromEnum AnyMidline = 0 + fromEnum NoFitMidline = 1 + fromEnum StandardTrimmedMidline = 2 + fromEnum StandardPointedMidline = 3 + fromEnum StandardSerifedMidline = 4 + fromEnum HighTrimmedMidline = 5 + fromEnum HighPointedMidline = 6 + fromEnum HighSerifedMidline = 7 + fromEnum ConstantTrimmedMidline = 8 + fromEnum ConstantPointedMidline = 9 + fromEnum ConstantSerifedMidline = 10 + fromEnum LowTrimmedMidline = 11 + fromEnum LowPointedMidline = 12 + fromEnum LowSerifedMidline = 13 + toEnum 0 = AnyMidline + toEnum 1 = NoFitMidline + toEnum 2 = StandardTrimmedMidline + toEnum 3 = StandardPointedMidline + toEnum 4 = StandardSerifedMidline + toEnum 5 = HighTrimmedMidline + toEnum 6 = HighPointedMidline + toEnum 7 = HighSerifedMidline + toEnum 8 = ConstantTrimmedMidline + toEnum 9 = ConstantPointedMidline + toEnum 10 = ConstantSerifedMidline + toEnum 11 = LowTrimmedMidline + toEnum 12 = LowPointedMidline + toEnum 13 = LowSerifedMidline + toEnum _ = error "Unknown midline" data BXHeight = AnyXHeight @@ -1035,7 +1139,38 @@ data BXHeight | DuckingSmallXHeight | DuckingStandardXHeight | DuckingLargeXHeight - deriving (Eq, Show) + deriving Eq + +instance Show BXHeight + where + show AnyXHeight = "Any" + show NoFitXHeight = "No Fit" + show ConstantSmallXHeight = "Constant/Small" + show ConstantStandardXHeight = "Constant/Standard" + show ConstantLargeXHeight = "Constant/Large" + show DuckingSmallXHeight = "Ducking/Small" + show DuckingStandardXHeight = "Ducking/Standard" + show DuckingLargeXHeight = "Ducking/Large" + +instance Enum BXHeight + where + fromEnum AnyXHeight = 0 + fromEnum NoFitXHeight = 1 + fromEnum ConstantSmallXHeight = 2 + fromEnum ConstantStandardXHeight = 3 + fromEnum ConstantLargeXHeight = 4 + fromEnum DuckingSmallXHeight = 5 + fromEnum DuckingStandardXHeight = 6 + fromEnum DuckingLargeXHeight = 7 + toEnum 0 = AnyXHeight + toEnum 1 = NoFitXHeight + toEnum 2 = ConstantSmallXHeight + toEnum 3 = ConstantStandardXHeight + toEnum 4 = ConstantLargeXHeight + toEnum 5 = DuckingSmallXHeight + toEnum 6 = DuckingStandardXHeight + toEnum 7 = DuckingLargeXHeight + toEnum _ = error "Unknown X height" -- * Kern table |
