Chart-diagrams 1.9.3 → 1.9.4
raw patch · 2 files changed
+14/−38 lines, 2 filesdep ~SVGFontsdep ~lensdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: SVGFonts, lens, mtl
API changes (from Hackage documentation)
Files
Chart-diagrams.cabal view
@@ -1,5 +1,5 @@ Name: Chart-diagrams-Version: 1.9.3+Version: 1.9.4 License: BSD3 License-file: LICENSE Copyright: Jan Bracker, 2006-2014@@ -9,7 +9,7 @@ Synopsis: Diagrams backend for Charts. Description: Diagrams backend for Charts. Category: Graphics-Cabal-Version: >= 1.6+Cabal-Version: 1.18 Build-Type: Simple data-files: fonts/LinLibertine_R.svg@@ -25,14 +25,15 @@ library+ default-language: Haskell98 Build-depends: base >= 3 && < 5 , old-locale , time, mtl- , diagrams-core >= 1.3 && < 1.5+ , diagrams-core >= 1.3 && < 1.6 , diagrams-lib >= 1.2 && < 1.5 , diagrams-svg >= 1.4 && < 1.5 , diagrams-postscript >= 0.7 && < 1.6- , SVGFonts >= 1.4 && < 1.8+ , SVGFonts >= 1.8 && < 1.9 , colour >= 2.2.1 && < 2.4 , blaze-markup >= 0.7 && < 0.9 , svg-builder >= 0.1 && < 0.2@@ -40,7 +41,7 @@ , operational >= 0.2.2 && < 0.3 , containers >= 0.4 && < 0.7 , data-default-class < 0.2- , lens >= 3.9 && < 4.19+ , lens >= 3.9 && < 5.2 , Chart >= 1.9 && < 1.10 , text other-modules: Paths_Chart_diagrams
Graphics/Rendering/Chart/Backend/Diagrams.hs view
@@ -395,7 +395,10 @@ let fs = envFontStyle env let (scaledH, scaledA, scaledD, scaledYB) = calcFontMetrics env return (mempty, TextSize- { textSizeWidth = realToFrac $ D2.width $ F.textSVG' (fontStyleToTextOpts env) text+ { textSizeWidth = realToFrac $ D2.width+ $ F.drop_rect+ $ F.fit_height scaledH+ $ F.svgText (fontStyleToTextOpts env) text , textSizeAscent = realToFrac scaledA -- scaledH * (a' / h') -- ascent , textSizeDescent = realToFrac scaledD -- scaledH * (d' / h') -- descent , textSizeYBearing = realToFrac scaledYB -- -scaledH * (capHeight / h)@@ -412,10 +415,13 @@ => Point -> String -> DState (N b) (D.QDiagram b V2 (N b) Any) dDrawTextSvg (Point x y) text = do env <- get+ let (scaledH, _, _, _) = calcFontMetrics env return $ D.transform (toTransformation $ translate (Vector x y) 1) $ applyFontStyleSVG (envFontStyle env) $ D2.scaleY (-1)- $ F.textSVG_ (fontStyleToTextOpts env) text+ $ F.set_envelope+ $ F.fit_height scaledH+ $ F.svgText (fontStyleToTextOpts env) text dDrawTextNative :: (D.Renderable (D2.Text (N b)) b, D.TypeableFloat (N b)) => Point -> String -> DState (N b) (D.QDiagram b V2 (N b) Any)@@ -572,42 +578,11 @@ fontStyleToTextOpts env = let fs = envFontStyle env font = envSelectFont env fs- (scaledH, _, _, _) = calcFontMetrics env in F.TextOpts { F.textFont = font- , F.mode = F.INSIDE_H , F.spacing = F.KERN , F.underline = False- , F.textWidth = 1- , F.textHeight = scaledH -- _font_size fs }--{-# DEPRECATED fontFromName "This function will be removed in the next release" #-}--#if MIN_VERSION_SVGFonts(1,7,0)-{-- We need this `unsafePerformIO` to deal with breaking- change in SVGFonts, which has changed the types of `F.lin` and `F.bit`- from `F.PreparedFont n` to `IO F.PreparedFont n`.- These functions simply read the files from `data-files`- of `SVGFonts`.--}-getPreparedFont = unsafePerformIO-#else-getPreparedFont = id-#endif--{-- The `fontFromName` function is not used inside this module.- It is not exported either. So it is safe to remove it- in the future release thus escaping use of `unsafePerformIO`.--}--fontFromName :: (Read n, RealFloat n) => String -> F.PreparedFont n-fontFromName name = case name of- "serif" -> getPreparedFont F.lin- "monospace" -> getPreparedFont F.bit- _ -> getPreparedFont F.lin -- | Convert line caps. convertLineCap :: LineCap -> D.LineCap