Closed
Bug 80224
Opened 24 years ago
Closed 24 years ago
Xlib-toolkit's nsFontMetricsXlib.cpp is missing tons of nsFontCharSetMap mappings...
Categories
(SeaMonkey :: UI Design, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: roland.mainz, Assigned: timecop)
References
()
Details
(Keywords: intl, Whiteboard: want for 0.9.2)
Attachments
(5 files)
36.99 KB,
image/gif
|
Details | |
35.52 KB,
image/gif
|
Details | |
73.73 KB,
patch
|
Details | Diff | Splinter Review | |
77.53 KB,
patch
|
Details | Diff | Splinter Review | |
103.99 KB,
patch
|
Details | Diff | Splinter Review |
Xlib-toolkit has problems finding matching fonts on pages which need
non-ISO-Latin-1 fonts...
Looking at mozilla/gfx/src/gtk/nsFontmetricsGTK.cpp and comparing it with
nsFontMetricsXlib.cpp - it looks like there are tons of nsFontCharSetMap
mappings missing...
Note that a patch should also fix mozilla/gfx/src/xprint/nsFontmetricsXP.cpp as
this is a 1:1 copy+s/Xlib/Xp/ from nsFontMetricsXlib.cpp (after checkin of bug
78548)...
Reporter | ||
Comment 1•24 years ago
|
||
Patch is simple (setting milestone to 0.9.1) - but requires checkin of bug 78548
first...
Accepting bug...
Reporter | ||
Comment 2•24 years ago
|
||
nsDeviceContextXlib::GetMetricsFor()/nsDeviceContextXp::GetMetricsFor() needs to
be implemented, too.
Example (from my test build - needs further testing!!):
-- snip --
NS_IMETHODIMP nsDeviceContextXp::GetMetricsFor(const nsFont& aFont,
nsIFontMetrics *&aMetrics)
{
GetLocaleLangGroup();
return GetMetricsFor(aFont, mLocaleLangGroup, aMetrics);
}
NS_IMETHODIMP nsDeviceContextXp::GetMetricsFor(const nsFont& aFont,
nsIAtom* aLangGroup, nsIFontMetrics *&aMetrics)
{
PRInt32 n,cnt;
nsresult rv;
// First check our cache
n = mFontMetrics.Count();
for (cnt = 0; cnt < n; cnt++)
{
aMetrics = (nsIFontMetrics*) mFontMetrics.ElementAt(cnt);
const nsFont* font;
aMetrics->GetFont(font);
nsCOMPtr<nsIAtom> langGroup;
aMetrics->GetLangGroup(getter_AddRefs(langGroup));
if (aFont.Equals(*font) && (aLangGroup == langGroup.get()))
{
NS_ADDREF(aMetrics);
return NS_OK;
}
}
// It's not in the cache. Get font metrics and then cache them.
nsIFontMetrics* fm = new nsFontMetricsXp();
if (nsnull == fm) {
aMetrics = nsnull;
return NS_ERROR_FAILURE;
}
rv = fm->Init(aFont, aLangGroup, this);
if (NS_OK != rv) {
aMetrics = nsnull;
return rv;
}
mFontMetrics.AppendElement(fm);
NS_ADDREF(fm); // this is for the cache
for (cnt = 0; cnt < n; cnt++){
aMetrics = (nsIFontMetrics*) mFontMetrics.ElementAt(cnt);
const nsFont *font;
aMetrics->GetFont(font);
}
NS_ADDREF(fm); // this is for the routine that needs this font
aMetrics = fm;
return NS_OK;
}
-- snip --
I'll wait for checkin of patches in bug 78548 and then fix this issue...
Reporter | ||
Comment 3•24 years ago
|
||
Found testcase (http://people.netscape.com/ftang/demo/utf8form.html).
ftang: can you have a quickish look at the Xlib-toolkit code
(mozilla/gfx/src/xlib/) and check if you can see the issue why
http://people.netscape.com/ftang/demo/utf8form.html is not viewed correctly
(I'll add a screenshot). I still cannot get it working... ;-((
Reporter | ||
Comment 4•24 years ago
|
||
Reporter | ||
Comment 5•24 years ago
|
||
Reporter | ||
Comment 6•24 years ago
|
||
Added screenshot from GTK+ toolkit viewing the same URL - this one looks OK so
far...
Keywords: intl
Reporter | ||
Comment 7•24 years ago
|
||
Retargeting, new milestone is 0.9.2 - first bug 81311 has to be fixed...
Target Milestone: mozilla0.9.1 → mozilla0.9.2
This patch includes FontMetrics changes from 66082 (very little if I remember
correctly) plus syncs the source with the GTK version (I assume that one works
the best).
Xlib font output now matches GTK font output pixel by pixel, at least on my
system.
tim
Reporter | ||
Comment 10•24 years ago
|
||
Patch looks nice - but it relies on bug 66082... adding dependicy...
Depends on: 66082
Reporter | ||
Comment 11•24 years ago
|
||
Requesting r=/sr= for that patch... tor/blizzard ?
Assignee | ||
Comment 12•24 years ago
|
||
Assignee | ||
Comment 13•24 years ago
|
||
Let's wait on bug 16688 until its accepted - it has a macro for one of the files
in the unicode encoder directory, and I'd rather wait for that to be in than
duplicate it in xlib code. The patch will be pretty straightforward to adapt to
Xlib though.
Assignee | ||
Comment 14•24 years ago
|
||
By the way it does not rely on bug 66082 - I just pulled orig versions of
nsFontMetricsXlib from cvs and made a patch against them.
So with approval this should go in. The code is almost line-by-line copy of the
GTK version, and its organized in the same way, so it should be possible to
track GTK changes in here easily.
There are still issues with GTK font metrics though, but I am sure there are
other bugs open on that.
No longer depends on: 66082
Reporter | ||
Comment 15•24 years ago
|
||
Welcome to patch _hell_... ;-(((
I cannot apply the patches, both old and new after I patched my tree with
patches in bug 66082...
Uhm... pocemit, you do not have a patch which fits into patched tree (e.g.
appiles cleanly after patches in bug 66082 have been appiled) ?
I am currently working on a new patch for bug 66082 to get sr=...
Assignee | ||
Comment 16•24 years ago
|
||
Okay, I fucked up. This DOES indeed depend on 66082.
The patch sequence should be like this:
1. Clean tree
2. Patch all of 66082
3. Get clean nsFontMetricsXlib.*
4. patch this
I am sorry. I totally missed that font metrics were converted to gc-cache as well.
This is why it is so critical these patches go in immediately :)
Reporter | ||
Comment 17•24 years ago
|
||
yes... but it looks bug 66082 will be "in" the tree at the end of this week
(hopefully... hopefully...)... :-))
pocemit:
Wanna file a new patch for the tree after checkin of latest patch in bug 66082,
please ? I'd like to get this r=/sr='ed as _soon_ as possible...
Whiteboard: want for 0.9.1 → want for 0.9.2
Reporter | ||
Comment 18•24 years ago
|
||
pocemit:
Once bug 66082 is "in" the tree:
Please file a new patch incl. solution for bug 16688 (just copy the macros from
intl/uconv/public/nsIUnicodeEncoder.h and wrap them with #ifndef
ENCODER_BUFFER_ALLOC_IF_NEEDED // then define our own macros - for now until
patch in bug 16688 get's checked-in) and request r=/sr= for it. I'll be back on
sunday/monday...
Assignee | ||
Comment 19•24 years ago
|
||
Okay, as requested by gisburn, here is the latest patch, ready for review.
As mentioned earlier in the comments, this patch brings Xlib port
nsFontMetricsXlib.cpp into sync with the GTK version, adding things like
language groups, proper font matching, etc.
This is a cut & paste + adapt from the GTK port, so there shouldn't be any bugs
here. This also includes the patch from bug 16688 which removes the 512
character limit for things like DrawString/GetWidth/etc.
Reviews are welcome.
Assignee | ||
Comment 20•24 years ago
|
||
Reporter | ||
Comment 21•24 years ago
|
||
Requesting r=/sr= for that patch, please...
Reporter | ||
Comment 22•24 years ago
|
||
Lates patch looks good and works OK (even with ISO-8859-2, japanese and thai
pages).
r=gisburn (roland.mainz@informatik.med.uni-giessen.de)
Reporter | ||
Comment 23•24 years ago
|
||
Oh... yes... I forgot... reassining to timecop@network.email.ne.jp - he's doing
the main work... :-)
Assignee: Roland.Mainz → timecop
Status: ASSIGNED → NEW
Reporter | ||
Comment 24•24 years ago
|
||
Requesting sr= tor/blizzard ?
Reporter | ||
Comment 25•24 years ago
|
||
pocemit:
Can you view http://www.walla.co.il/ correctly (hebrew) with your Xlib-toolkit
build ?
Comment 26•24 years ago
|
||
sr=tor
Reporter | ||
Comment 27•24 years ago
|
||
Requesting a= ...
This patch is simple and the risk is minor as only Xlib-tookit code is patched -
not part of default build...
Comment 28•24 years ago
|
||
a=blizzard on behalf of drivers for the trunk
Reporter | ||
Comment 29•24 years ago
|
||
[as discussed in IRC #mozilla]
CC:'ing mkaply for checkin...
Comment 30•24 years ago
|
||
Fix checked in
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
QA Contact: sairuh → teruko
Comment 31•24 years ago
|
||
Roland.Mainz@informatik.med.uni-giessen.de, please verify this bug.
QA Contact: teruko → Roland.Mainz
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•