[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Bug#22529: khtml http://axkit.org/ utf-8 encoding problems revisited
From:       Martin Junius <mj () m-j-s ! net>
Date:       2001-03-31 20:39:20
[Download RAW message or body]

Dirk Mueller <mueller@kde.org> writes:

> > If you can give me a quick pointer to where this font mapping happens
> > in the kdelibs/khtml source, I'm willing to look into it and
> > experiment with alternate schemes.
> 
> Great. the code is mostly in css/cssstyleselector.cpp around line 1800. 

OK, here are my first results from digging thru the sources.
Font path set to /usr/X11R6/lib/X11/fonts/75dpi,/usr/share/fonts
Test case http://www.m-j-s.net/test/test-utf8.html (charset=utf-8)
Testing done using testkhtml from the the kdelib-2.1 (release)
sources.

----- Normal
khtmlrc settings

DefaultEncoding=
EnforceDefaultCharset=false

Result from cssstyleselector.c(khtml::applyRule):1966 searching for
font family "Helvetica":

Testkhtml: KHTMLSettings charset=unicode script=unicode encoding=
Testkhtml: searching for font... available:console,fixed
Testkhtml: searching for face 'helvetica'
khtml (css): no match for font family helvetica, got console

OK, there is no Helvetica with unicode, so the default console unicode
font coming with KDE is used. Ugly display using the scaled fixed
width font console.


----- Trying ISO-8859-1
DefaultEncoding=iso 8859-1
EnforceDefaultCharset=false

Testkhtml: KHTMLSettings charset=unicode script=unicode encoding=iso 8859-1
Testkhtml: searching for font... available:console,fixed
Testkhtml: searching for face 'helvetica'
khtml (css): no match for font family helvetica, got console

Same thing, setting DefaultEncoding doesn't change the display.


----- Trying enforced ISO-8859-1
DefaultEncoding=iso 8859-1
EnforceDefaultCharset=true

Testkhtml: KHTMLSettings charset=Any script=unicode encoding=iso 8859-1
Testkhtml: searching for font... available:
Testkhtml: searching for face 'helvetica'
khtml (css): no match for font family helvetica, got helvetica

OK, the flag EnforceDefaultCharset seems to do what I want, not
entirely, but yielding something which approach the right result. ;-)

IMHO, using the settings as above should yields the following:
- If EnforceDefaultCharset is set, KHTMLSettings charset should be
  ISO-8859-1, *not* "Any" as right now.
- The list of available fonts should then resemble the installed
  iso-8859-1 fonts and *not* be empty. Alternatively charset=Any 
  should list *all* available fonts.
- Searching the list then will find "Helvetica". (Right now is uses
  Helvetica because this is the default font in this test case.)

So basically everything to help with the font problem in this bug
report is already there, we just need a checkbox for
EnforceDefaultCharset in the konqueror appearance settings.

If you think that this is the right thing <tm> ;-) to do, I'm even
volunteering to implement this and fix the EnforceDefaultCharset
behavior.

Martin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic