[librsvg: 4/14] text: move conversion trait for TextRendering



commit fbcf054c16db47dc22a08253acc861c9962937ed
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Jan 5 10:58:20 2019 +0100

    text: move conversion trait for TextRendering
    
    Move near all the other conversion used for text

 rsvg_internals/src/drawing_ctx.rs | 12 ------------
 rsvg_internals/src/text.rs        | 12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index f2398c22..34e14adf 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -30,7 +30,6 @@ use state::{
     StrokeDasharray,
     StrokeLinecap,
     StrokeLinejoin,
-    TextRendering,
 };
 use unit_interval::UnitInterval;
 use viewbox::ViewBox;
@@ -919,17 +918,6 @@ impl From<ShapeRendering> for cairo::Antialias {
     }
 }
 
-impl From<TextRendering> for cairo::Antialias {
-    fn from(tr: TextRendering) -> cairo::Antialias {
-        match tr {
-            TextRendering::Auto
-            | TextRendering::OptimizeLegibility
-            | TextRendering::GeometricPrecision => cairo::Antialias::Default,
-            TextRendering::OptimizeSpeed => cairo::Antialias::None,
-        }
-    }
-}
-
 #[derive(Default, Clone, Copy, Debug, PartialEq)]
 #[repr(C)]
 pub struct RsvgRectangle {
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index 93155167..5d19eeee 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -24,6 +24,7 @@ use state::{
     FontStyle,
     FontVariant,
     TextAnchor,
+    TextRendering,
     UnicodeBidi,
     WritingMode,
     XmlLang,
@@ -798,6 +799,17 @@ impl<'a> From<&'a XmlLang> for pango::Language {
     }
 }
 
+impl From<TextRendering> for cairo::Antialias {
+    fn from(tr: TextRendering) -> cairo::Antialias {
+        match tr {
+            TextRendering::Auto
+            | TextRendering::OptimizeLegibility
+            | TextRendering::GeometricPrecision => cairo::Antialias::Default,
+            TextRendering::OptimizeSpeed => cairo::Antialias::None,
+        }
+    }
+}
+
 impl From<FontStyle> for pango::Style {
     fn from(s: FontStyle) -> pango::Style {
         match s {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]