aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SVG/SVG2zinc.pm4
-rw-r--r--src/SVG/SVG2zinc/Conversions.pm6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/SVG/SVG2zinc.pm b/src/SVG/SVG2zinc.pm
index 6c33b6f..22d41bb 100644
--- a/src/SVG/SVG2zinc.pm
+++ b/src/SVG/SVG2zinc.pm
@@ -1839,10 +1839,10 @@ sub analyze_text_style_hash
{
## to be extended to all other fonts definition parameters
## NB: fontWeight is not used yet!
- my ($fontKey,$code) = &createNamedFont ($fontFamily, $fontSize, $fontWeight);
+ my ($fontKey,$fontName,$code) = &createNamedFont ($fontFamily, $fontSize, $fontWeight);
&display("\$fonts{\"$fontKey\"} = ") if $code;
&display($code) if $code;
- $res .= ", -font => \"$fontKey\"";
+ $res .= ", -font => \"$fontName\"";
$current_font_key = $fontKey;
}
return $res;
diff --git a/src/SVG/SVG2zinc/Conversions.pm b/src/SVG/SVG2zinc/Conversions.pm
index 516c8d3..24564ea 100644
--- a/src/SVG/SVG2zinc/Conversions.pm
+++ b/src/SVG/SVG2zinc/Conversions.pm
@@ -142,14 +142,16 @@ sub createNamedFont {
}
my $fontKey = join "_", ($family, $size, $weight);
+ my $fontName = $fontKey;
+ $fontKey =~ s/^-/XLFD-/;
if (!defined $fonts{$fontKey})
{
$fonts{$fontKey} = $fontKey;
- return ($fontKey, "->fontCreate('$fontKey', -family => \"$family\", -size => $size, -weight => \"$weight\") if ! \$fonts {\"$fontKey\"};");
+ return ($fontKey, $fontName, "->fontCreate('$fontKey', -family => \"$family\", -size => $size, -weight => \"$weight\") if ! \$fonts {\"$fontKey\"};");
}
else
{
- return ($fontKey,"");
+ return ($fontKey, $fontName, "");
}
} # end of createNamedFont