作図ソフト dia の改良版
Revisão | e59b01e9d90ba0556dfb04de205c6830870bedfd (tree) |
---|---|
Hora | 2014-10-10 03:01:14 |
Autor | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
[transform] svg: import transformation from <text transform="...">
With the last commit implementing "Standard - Text"::transform() text
transformation is much easier and more correct.
@@ -785,8 +785,6 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style, | ||
785 | 785 | multiline = NULL; |
786 | 786 | } |
787 | 787 | if(str || multiline) { |
788 | - if (matrix) | |
789 | - transform_point (&point, matrix); | |
790 | 788 | new_obj = otype->ops->create(&point, otype->default_user_data, |
791 | 789 | &h1, &h2); |
792 | 790 | list = g_list_append (list, new_obj); |
@@ -813,13 +811,8 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style, | ||
813 | 811 | /* font-size should be the line-height according to SVG spec, |
814 | 812 | * but see node_set_text_style() - round-trip first */ |
815 | 813 | real font_scale = dia_font_get_height (prop->attr.font) / dia_font_get_size (prop->attr.font); |
816 | - if (matrix) /* ToDo: more text transform - or not at all? */ | |
817 | - transform_length (&font_height, matrix); | |
818 | 814 | prop->attr.height = font_height * font_scale; |
819 | 815 | } else { |
820 | - real fh = gs->font_height; | |
821 | - if (matrix) | |
822 | - transform_length (&fh, matrix); | |
823 | 816 | prop->attr.height = gs->font_height; |
824 | 817 | } |
825 | 818 | /* when operating with default values foreground and background are intentionally swapped |
@@ -843,6 +836,10 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style, | ||
843 | 836 | } |
844 | 837 | new_obj->ops->set_props(new_obj, props); |
845 | 838 | prop_list_free(props); |
839 | + if (matrix) { | |
840 | + g_return_val_if_fail (new_obj->ops->transform, list); | |
841 | + new_obj->ops->transform(new_obj, matrix); | |
842 | + } | |
846 | 843 | } |
847 | 844 | if (gs->font) |
848 | 845 | dia_font_unref (gs->font); |