diff --git a/components/fpvectorial/fpvectorial.pas b/components/fpvectorial/fpvectorial.pas index 240ae4d4f2..03bc87e195 100644 --- a/components/fpvectorial/fpvectorial.pas +++ b/components/fpvectorial/fpvectorial.pas @@ -5693,6 +5693,7 @@ constructor TvText.Create(APage: TvPage); begin inherited Create(APage); Value := TStringList.Create; + Value.Options := Value.Options - [soTrailingLineBreak]; Font.Color := colBlack; end; @@ -5799,7 +5800,7 @@ begin lDescender := GetTextMetric_Descender_px(ARenderInfo); // Angle of text rotation - phi := sign(AMulY) * DegToRad(Font.Orientation); + phi := -DegToRad(Font.Orientation); // Reference point of the entity (X,Y) in pixels // rotation center in case of rotated text @@ -5830,9 +5831,7 @@ begin // ... // We need to keep the order of lines drawing correct regardless of // the drawing direction - lowerDimY := refPt.Y - (lTextSize.CY - lDescender); // lowerDim.Y := refPt.Y + lFontSizePx * (1 + LINE_SPACING) * Value.Count * AMulY - upperDimY := refPt.Y; - curDimY := IfThen(AMulY < 0, lowerDimY, upperDimY); + curDimY := refPt.Y - (lTextSize.CY - lDescender); // TvText supports multiple lines for i := 0 to Value.Count - 1 do diff --git a/components/fpvectorial/svgvectorialwriter.pas b/components/fpvectorial/svgvectorialwriter.pas index ddc6716971..a791204276 100644 --- a/components/fpvectorial/svgvectorialwriter.pas +++ b/components/fpvectorial/svgvectorialwriter.pas @@ -633,6 +633,7 @@ const TEXT_ANCHORS: array[TvTextAnchor] of string = ('start', 'middle', 'end'); TEXT_DECO: array[0..3] of string = ('none', 'underline', 'line-through', 'line-through,underline'); var + FontName: String; FontSize: Double; TextStr: String; PtX: Double = 0.0; @@ -640,11 +641,10 @@ var begin ConvertFPVCoordinatesToSVGCoordinates(APage, AText.X, AText.Y, PtX, PtY); TextStr := AText.Value.Text; - if DefaultTextLineBreakStyle = tlbsCRLF then // Trim extra CRLF appended by TStringList.Text - TextStr := Copy(TextStr, 1, Length(TextStr) - 2) + if AText.Font.Name = '' then + FontName := 'Arial,Helvetica,sans-serif' else - TextStr := Copy(TextStr, 1, Length(TextStr) - 1); - + FontName := AText.Font.Name; FontSize:= AText.Font.Size * FLOAT_PIXELS_PER_MILLIMETER; AStrings.Add(' '); - AStrings.Add(TextStr); - AStrings.Add(' '); + AStrings.Add(' >' + TextStr + ''); end; procedure TvSVGVectorialWriter.WriteToStrings(AStrings: TStrings;