diagrams-rasterific 0.1.0.6 → 0.1.0.7
raw patch · 3 files changed
+13/−7 lines, 3 filesdep ~FontyFruitydep ~RasterificPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: FontyFruity, Rasterific
API changes (from Hackage documentation)
Files
- CHANGES.md +5/−0
- diagrams-rasterific.cabal +3/−3
- src/Diagrams/Backend/Rasterific.hs +5/−4
CHANGES.md view
@@ -1,3 +1,8 @@+0.1.0.7 (Feb 10 2015)++ - Allow 'Fontyfruity-0.5'+ - Allow 'Rasterific-0.5'+ 0.1.0.6 (13 Jan 2015) ---------------------
diagrams-rasterific.cabal view
@@ -1,5 +1,5 @@ name: diagrams-rasterific-version: 0.1.0.6+version: 0.1.0.7 synopsis: Rasterific backend for diagrams. description: A full-featured backend for rendering diagrams using the Rasterific rendering engine.@@ -30,8 +30,8 @@ directory, diagrams-core >= 1.2 && < 1.3, diagrams-lib >= 1.2 && < 1.3,- Rasterific >= 0.2 && < 0.5,- FontyFruity >= 0.2 && < 0.5,+ Rasterific >= 0.5 && < 0.6,+ FontyFruity >= 0.5 && < 0.6, JuicyPixels >= 3.1.5 && < 3.3, lens >= 4.0 && < 4.8, mtl >= 2.1 && < 2.3,
src/Diagrams/Backend/Rasterific.hs view
@@ -107,7 +107,7 @@ import qualified Graphics.Rasterific.Transformations as R -import Graphics.Text.TrueType (loadFontFile, Font, stringBoundingBox)+import Graphics.Text.TrueType import Control.Lens hiding (transform, ( # ))@@ -411,10 +411,11 @@ fromFontStyle FontSlantOblique FontWeightNormal = openSansItalic fromFontStyle _ _ = openSansRegular -textBox :: Font -> Int -> String -> (Double, Double)+textBox :: Font -> R.PointSize -> String -> (Double, Double) textBox f ps str = (float2Double w, float2Double h) where- (w, h) = stringBoundingBox f 96 ps str+ bb = stringBoundingBox f 96 ps str+ (w, h) = (_xMax bb - _xMin bb, _yMax bb - _yMin bb) instance Renderable Text Rasterific where render _ (Text tt tn al str) = R $ do@@ -426,7 +427,7 @@ <$> getStyleAttrib getFillTexture o <- fromMaybe 1 <$> getStyleAttrib getOpacity let fColor = rasterificTexture f o- fs' = round fs+ fs' = R.PointSize . double2Float $ fs fnt = fromFontStyle slant fw (x, y) = textBox fnt fs' str (refX, refY) = case al of