Issue 19591 - Font subst semantics does not match specs (helpcontent doc)
Summary: Font subst semantics does not match specs (helpcontent doc)
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 RC4
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 1.1.1
Assignee: ulf.stroehler
QA Contact: issues@gsl
URL:
Keywords:
: 19589 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-09-15 10:53 UTC by gbeauche
Modified: 2004-06-28 07:19 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Make font substitution algorithm match doc (3.74 KB, patch)
2003-09-15 13:28 UTC, gbeauche
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description gbeauche 2003-09-15 10:53:29 UTC
Considering this excerpt from help: "Select Always to replace both the screen
font and the printer font, even if the original font is installed on your
system. Select Screen to replace the screen font only."

My interpretation is that if there is a font substitution such that "Helvetica"
maps to "Luxi Sans" (or "Bitstream Vera Sans") and only "Screen" box is checked,
then Helvetica is substituted on screen only, including helpcontent. Right?

However, opening helpcontent yields that the <HeadN> text is not anti-aliased
(helvetica is not anti-alias capable under Linux with default fonts). i.e. I
conclude font substitution was not taken into account.

If, I were to check the "Always" box, I get correct font substitution (anti
aliased text this time). I believe font subst logics is reversed in
ImplFontCache::Get().
Comment 1 gbeauche 2003-09-15 11:26:06 UTC
Let's make a truth table from the help specs. There are two cases:

1) A printer device

Always	ScreenOnly	Substitute
0	0		NO
0	1		NO
1	0		YES
1	1		NO

2) A screen device

Always	ScreenOnly	Substitute
0	0		NO
0	1		YES
1	0		YES
1	1		YES

Assuming the truth tables are correct, the reader can induce the
resulting mask,match code. ;-)
Comment 2 gbeauche 2003-09-15 13:27:42 UTC
The resulting boolean function is: (!P && S) || (A && !S) with the
following variables:
- P: is it a printer device?
- A: always?
- S: on screen only?

I don't know German, but I am attaching a tentative fix.
Comment 3 gbeauche 2003-09-15 13:28:32 UTC
Created attachment 9328 [details]
Make font substitution algorithm match doc
Comment 4 christof.pintaske 2003-09-15 17:07:05 UTC
*** Issue 19589 has been marked as a duplicate of this issue. ***
Comment 5 christof.pintaske 2003-09-15 17:11:05 UTC
cp->ssa: I would assume that "always" makes the "screen only" setting
irrelevant. Please have a look.
Comment 6 gbeauche 2003-09-15 17:34:08 UTC
i.e. ignore the "ScreenOnly" attribute even for a printer device?

In that case, this complicates a bit the boolean expression. I am
reaching: (P && A) || (!P && (S || (A && !S))).

I don't know how to factor out this one better.

NOTE: use the usual Boole algebreaic notation to read that better. ;-)
Comment 7 stephan_schaefer 2003-11-24 13:52:39 UTC
ssa->hdu: please have a look.
Comment 8 hdu@apache.org 2003-11-25 16:09:09 UTC
Thanks for working on this unpleasant part of the code. The font list
management and caches are due for a rework soon.

I'm applying the patch with this expression
(P && A) || (!P && (S || A))
Comment 9 hdu@apache.org 2003-11-25 16:17:42 UTC
This should have been (A || (!P && S))
Comment 10 hdu@apache.org 2003-11-26 11:15:21 UTC
Digging into the code and its comments it looks like the complete
truth table is supposed to be:

Always ScreenOnly Available ForDisplay => Substitute
  0       0           0         x             1
  0       0           1         x             0
  0       1           x         0             0
  0       1           x         1             1
  1       0           x         x             1
  1       1           x         x         undefined (default to 1)

Don't blame me, I just inherited it. I'd rather not touch this font
matching code again until the rewrite is due. Font matching is
extremely critical for the whole document layout.
Comment 11 hdu@apache.org 2003-11-26 11:40:00 UTC
Fixed in CWS vcl7pp1r4.
Comment 12 hdu@apache.org 2003-12-18 14:55:08 UTC
HDU->US: please verify in CWS vcl7pp1r4.
Comment 13 ulf.stroehler 2004-01-06 15:44:04 UTC
changing Resolution to FIXED in order to mark issue verified.
Comment 14 ulf.stroehler 2004-01-06 15:55:21 UTC
VERIFIED!
Thanks HDU for the good work!

US->US: especially the following constellation may be misleading.
Note: the resulting substitution refers to the device specified in the column
before.

This means concrete: "[font] ForDisplay" == "0" is a printer font and the
substitution is "0" on the printer device. But on the screen there is a visible
substitution, as specified by the user by "ScreenOnly" == "1".

Always ScreenOnly Available ForDisplay => Substitute

  0       1           x         0             0
Comment 15 ulf.stroehler 2004-01-06 15:56:05 UTC
.
Comment 16 ulf.stroehler 2004-01-22 17:09:04 UTC
Re-verified on resynced cws vcl7pp1r4.
Comment 17 ulf.stroehler 2004-01-29 16:15:30 UTC
ok in (internal) master workspace srx645_m27s1-1.8738.
Fix will be in fortcoming OOo 1.1.1.
Closing Resolved/Verified issue.
Comment 18 ghibo 2004-06-27 21:21:26 UTC
I've looked at OOo 1.1.3, but this seems not yet fixed, because
it doesn't take into account whether the font to be substituted
is installed or not.

Suppose I've the substitution:

Always  Screen           Font     Replace with
[N]      [Y]             Arial => Bitstream Vera Sans

In this way, when "Arial" is not available/installed would use 
"Bitstream Vera Sans"; but suppose then I install the "Arial" (arial32.exe)
font using the FontOOo wizard. At next OOo startup the
Arial font would be available and thus Arial should be used
and the substitution "Arial => Bitstream Vera Sans" shouldn't be
performed; but indeed OOo 1.1.3 still performs this substitution,
and thus not taking care at all whether the font to be substituted
is added (exists) to OOo or not.
Comment 19 ulf.stroehler 2004-06-28 07:19:50 UTC
@ghibo: replacements as configured in OO.o's Tools-Options-OO.o-Fonts dialog
*always* perform a replacement no matter whether the substituted font is
available or not. Works as designed.

What you want is a font substitution (fallback list) for unavailable fonts. Pls.
refer to <OO.o_root_dir>/share/registry/data/org/openoffice/VCL.xcu.