kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

CSS font-family with quotes does not work #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which steps will reproduce the problem?

This HTML code will render correctly:
(attached file: test-ok.html)
<html>
    <head>
        <style>p {font-family:Calibri,sans-serif}</style>
    </head>
    <body>
        <p>Font test</p>
    </body>
</html>

This will NOT render correctly:
(attached file: test-fail.html)
<html>
    <head>
        <style>p {font-family:"Calibri","sans-serif"}</style>
    </head>
    <body>
        <p>Font test</p>
    </body>
</html>

The only difference is that the name of the font is quoted in the second 
example.

What is the expected output? What do you see instead?

Expected output is the text "Font test" rendered with the Calibri font, but 
instead it is rendered with the Times New Roman font which is the default font.

Which version of the product are you using? Which compiler version are you
using? On which operating system?

HTMLViewer version 11.13 r306
Delphi version 2006
OS version Windows 7 (64 bit)

Please attach test html files and screenshots, if appropriate.
Please provide any additional information:

Great project by the way! Keep up the good work :-)

Original issue reported on code.google.com by leo...@gmail.com on 4 Jul 2012 at 7:41

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

I'm glad to hear that you like HtmlViewer.
Thanks for spotting this issue and the easy to follow reproduction report.

r307 fixes the issue.

OrphanCat

Original comment by OrphanCat on 5 Jul 2012 at 8:17

GoogleCodeExporter commented 9 years ago
Hi, OrphanCat.

There are one more place, where you must change code.
in method:
procedure THtmlStyleAttrParser.ParseProperties(Doc: TBuffer; Propty: 
TProperties);

Was
  ProcessProperty(Prop, Value);

You must change to 
   if Prop = 'font-family' then
     ProcessProperty(Prop, Value1)
   else
     ProcessProperty(Prop, Value);

This needed to render correctly such html:
<html>
    <body>
         <span style='font-size:10.0pt;font-family:"Arial","sans-serif";mso-fareast-language:RU'> Test </span>
    </body>
</html>

Alexander

Original comment by 9ne...@gmail.com on 30 Aug 2012 at 3:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by OrphanCat on 26 Nov 2012 at 6:52

GoogleCodeExporter commented 9 years ago
Issue 218 has been merged into this issue.

Original comment by OrphanCat on 26 Nov 2012 at 7:05

GoogleCodeExporter commented 9 years ago
Alexander, thanks for the hint.

r342 fixes this issue for both locations.

Original comment by OrphanCat on 26 Nov 2012 at 7:10