fpvectorial: Fixes some text regressions introduced by the new text code

git-svn-id: trunk@44427 -
This commit is contained in:
sekelsenmat 2014-03-14 14:36:05 +00:00
parent e417930ab0
commit 8e41d00f33

View File

@ -1553,9 +1553,9 @@ begin
lText := TvText.Create(nil); lText := TvText.Create(nil);
// Apply the layer style // Apply the layer style
{ApplyLayerStyles(lText); ApplyLayerStyles(lText);
// read the attributes {// read the attributes
for i := 0 to ANode.Attributes.Length - 1 do for i := 0 to ANode.Attributes.Length - 1 do
begin begin
lNodeName := ANode.Attributes.Item[i].NodeName; lNodeName := ANode.Attributes.Item[i].NodeName;
@ -1715,7 +1715,7 @@ end;
procedure TvSVGVectorialReader.ReadLayerFromNode(ANode: TDOMNode; procedure TvSVGVectorialReader.ReadLayerFromNode(ANode: TDOMNode;
AData: TvVectorialPage; ADoc: TvVectorialDocument); AData: TvVectorialPage; ADoc: TvVectorialDocument);
var var
lNodeName: DOMString; lNodeName, lNodeValue: DOMString;
lLayerName: string = ''; lLayerName: string = '';
lCurNode, lLayerNameNode: TDOMNode; lCurNode, lLayerNameNode: TDOMNode;
lLayer: TvLayer; lLayer: TvLayer;
@ -1749,23 +1749,24 @@ begin
for i := 0 to ANode.Attributes.Length - 1 do for i := 0 to ANode.Attributes.Length - 1 do
begin begin
lNodeName := ANode.Attributes.Item[i].NodeName; lNodeName := ANode.Attributes.Item[i].NodeName;
lNodeValue := ANode.Attributes.Item[i].NodeValue;
if lNodeName = 'style' then if lNodeName = 'style' then
begin begin
{$ifdef SVG_MERGE_LAYER_STYLES} {$ifdef SVG_MERGE_LAYER_STYLES}
ReadSVGStyleToStyleLists(ANode.Attributes.Item[i].NodeValue, lLayerStyleKeys, lLayerStyleValues); ReadSVGStyleToStyleLists(lNodeValue, lLayerStyleKeys, lLayerStyleValues);
{$else} {$else}
lLayer.SetPenBrushAndFontElements += ReadSVGStyle(ANode.Attributes.Item[i].NodeValue, lLayer) lLayer.SetPenBrushAndFontElements += ReadSVGStyle(lNodeValue, lLayer)
{$endif} {$endif}
end end
else if IsAttributeFromStyle(lNodeName) then else if IsAttributeFromStyle(lNodeName) then
begin begin
{$ifdef SVG_MERGE_LAYER_STYLES} {$ifdef SVG_MERGE_LAYER_STYLES}
lLayerStyleKeys.Add(lNodeName); lLayerStyleKeys.Add(lNodeName);
lLayerStyleValues.Add(ANode.Attributes.Item[i].NodeValue); lLayerStyleValues.Add(lNodeValue);
{$else} {$else}
lLayer.SetPenBrushAndFontElements += ReadSVGPenStyleWithKeyAndValue(lNodeName, ANode.Attributes.Item[i].NodeValue, lLayer); lLayer.SetPenBrushAndFontElements += ReadSVGPenStyleWithKeyAndValue(lNodeName, lNodeValue, lLayer);
lLayer.SetPenBrushAndFontElements += ReadSVGBrushStyleWithKeyAndValue(lNodeName, ANode.Attributes.Item[i].NodeValue, lLayer); lLayer.SetPenBrushAndFontElements += ReadSVGBrushStyleWithKeyAndValue(lNodeName, lNodeValue, lLayer);
lLayer.SetPenBrushAndFontElements += ReadSVGFontStyleWithKeyAndValue(lNodeName, ANode.Attributes.Item[i].NodeValue, lLayer); lLayer.SetPenBrushAndFontElements += ReadSVGFontStyleWithKeyAndValue(lNodeName, lNodeValue, lLayer);
{$endif} {$endif}
end; end;
end; end;
@ -2429,7 +2430,7 @@ var
while lCurNode <> nil do while lCurNode <> nil do
begin begin
lNodeName := LowerCase(lCurNode.NodeName); lNodeName := LowerCase(lCurNode.NodeName);
lNodeValue := LowerCase(lCurNode.NodeValue); lNodeValue := lCurNode.NodeValue;
if lNodeName = 'tspan' then if lNodeName = 'tspan' then
begin begin
@ -2474,6 +2475,10 @@ var
begin begin
lText := lParagraph.AddText(lNodeValue); lText := lParagraph.AddText(lNodeValue);
lText.Font.Size := 10;
// Apply the layer style
ApplyLayerStyles(lText);
// Apply the layer style // Apply the layer style
ApplyStackStylesToText(lText); ApplyStackStylesToText(lText);
end; end;