Safe Haskell | None |
---|---|
Language | Haskell2010 |
Graphics.Text.Font.Choose.Weight
Description
Convert between OpenType & FontConfig weight scales.
Synopsis
- weightFromOpenTypeDouble :: Double -> Double
- weightToOpenTypeDouble :: Double -> Double
- weightFromOpenType :: Int -> Int
- weightToOpenType :: Int -> Int
Documentation
weightFromOpenTypeDouble :: Double -> Double Source #
Returns an double value to use with FC_WEIGHT, from an double in the 1..1000 range, resembling the numbers from OpenType specification's OS2 usWeight numbers, which are also similar to CSS font-weight numbers. If input is negative, zero, or greater than 1000, returns -1. This function linearly interpolates between various FC_WEIGHT_* constants. As such, the returned value does not necessarily match any of the predefined constants.
weightToOpenTypeDouble :: Double -> Double Source #
the inverse of FcWeightFromOpenType. If the input is less than FC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise returns a number in the range 1 to 1000.
weightFromOpenType :: Int -> Int Source #
Like weightFromOpenTypeDouble but with integer arguments. Use the other function instead.
weightToOpenType :: Int -> Int Source #
Like weightToOpenTypeDouble but with integer arguments. Use the other function instead.