There seem to be some problems with TChart - Title when using HTML as text format:
I used "<b>Header</b><small>(Details)</small>Test" (without the quotes) and a font size of 13 to get
1. The Header isn't centered in a correct way (centering seems to be based on the plain html-string)
2. The closing </small> - Tag is not recogniced
3. "Test" (and "</small>") is placed with a wrong baseline
By experimenting I found, that removing the "/" from the closing </small> tag has another effect:
It seems, as the </small> - tag is ignored the next string is drawn even smaller BUT also the baseline moves down (as if <sub></sub> where used).
Note: I do only need the first 2 parts "<b>Header</b><small>(Details)</small>", the "Test" string was just added when experimenting with the HTML expression.
TChart.Title not rendering correct when using HTML
Re: TChart.Title not rendering correct when using HTML
Hello,
I could reproduce the problem so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1528
I could also fix it. However, I'm afraid it couldn't be included in the maintenance release we've just published.
I could reproduce the problem so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1528
I could also fix it. However, I'm afraid it couldn't be included in the maintenance release we've just published.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChart.Title not rendering correct when using HTML
However, as you own the source code, you can apply the fix to your sources and recompile the packages with TeeRecompile.
Here the git patch from the commit, affecting only TeeHtml.pas (in your "Sources" folder):
Here the git patch from the commit, affecting only TeeHtml.pas (in your "Sources" folder):
Code: Select all
---
TeeHtml.pas | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/TeeHtml.pas b/TeeHtml.pas
index 407ecd4..a08c363 100644
--- a/TeeHtml.pas
+++ b/TeeHtml.pas
@@ -672,10 +672,28 @@ var
end
else
if tmpU='<BIG>' then
- NewSize(ACanvas.Font.Size+2)
+ begin
+ NewSize(ACanvas.Font.Size+2);
+ y:=y-4;
+ end
else
if tmpU='<SMALL>' then
- NewSize(ACanvas.Font.Size-2)
+ begin
+ NewSize(ACanvas.Font.Size-2);
+ y:=y-1;
+ end
+ else
+ if tmpU='</BIG>' then
+ begin
+ SetBackFont;
+ y:=y+2;
+ end
+ else
+ if tmpU='</SMALL>' then
+ begin
+ SetBackFont;
+ y:=y-2;
+ end
else
if tmpU='</SUB>' then
begin
@@ -689,13 +707,13 @@ var
y:=y+ACanvas.FontHeight;
end
else
- if tmpU='</SUPER>' then
+ if (tmpU='</SUPER>') or (tmpU='</SUP>') then
begin
SetBackFont;
y:=y+(ACanvas.FontHeight div 2);
end
else
- if tmpU='<SUPER>' then
+ if (tmpU='<SUPER>') or (tmpU='<SUP>') then
begin
NewSize(ACanvas.Font.Size {$IFDEF FMX}*0.5{$ELSE}div 2{$ENDIF});
y:=y-(ACanvas.FontHeight div 2);
--
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChart.Title not rendering correct when using HTML
Very nice!!
Thanx!
Thanx!