Fallback is not allowed for symbol font in linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fallback is not allowed for symbol font in linux

yanmin
Hi,

Fontconfig is leveraged during font fall back in Linux, which improved text
output quality. But font fall back using Fontconfig is not available for
symbol font, such as below code snippet,

*********************************************************************************************************************
bool FcGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData&
rFontSelData,
    rtl::OUString& rMissingCodes ) const
{
    // We dont' actually want to talk to Fontconfig at all for symbol fonts
    if( rFontSelData.IsSymbolFont() )
return false;
    // StarSymbol is a unicode font, but it still deserves the symbol flag
    if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii(
"starsymbol", 10)
    ||  0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii(
"opensymbol", 10) )
        return false;
************************************************************************************************************************
That lead to some bullet characters can not be displayed correctly some
times especially for the documents generated by Windows users.

I''m not sure whether it's any risk if remove the restriction in above code
for symbol font. Thanks.

Best regards,


--
Jia Yanmin (贾彦民)
IBM China Software Development Laboratory, Beijing
Tel: 8610-82454759  E-Mail:[hidden email] <E-Mail%[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Fallback is not allowed for symbol font in linux

Herbert Duerr
Hi,

> Fontconfig is leveraged during font fall back in Linux, which  
> improved text
> output quality. But font fall back using Fontconfig is not available  
> for
> symbol font, such as below code snippet,
> [...]
> That lead to some bullet characters can not be displayed correctly  
> some
> times especially for the documents generated by Windows users.

Cross-platform problems with bullets (especially for documents created  
on Windows) are most probably caused by the "Symbol" font being  
completely different things on different platforms. Please see http://www.openoffice.org/issues/show_bug.cgi?id=92011 
  for the full story with graphics.

Other than that you raise an interesting question:

> I''m not sure whether it's any risk if remove the restriction in  
> above code
> for symbol font. Thanks.


In OOo a font having the unicode-flag means that its code points have  
the meaning as specified by the unicode standard whereas the symbol-
flag means that the code points only have a meaning specific to this  
font. A fallback for a code point only makes sense when the code point  
has a defined semantic. For this reason glyph fallback does not  
substitute fonts with the symbol flag.

Of course some symbol fonts are so common that the layout of their  
code points is a de-facto standard. If these fonts are not available a  
different kind of substitution is performed: the symbol font remapping  
substitution. Please see vcl/source/gdi/fontcvt.cxx for the maps from  
common symbol fonts to OpenSymbol.

Coming back to your question about removing the restriction to allow  
only unicode-fonts for glyph fallback: it would probably impact this  
symbol-substitution conversion and introduce "false hits", i.e. the  
fall-back of the code point would succeed but the resulting glyph  
could look completely different as it is from a different symbol font.  
On the other hand removing the restriction for code points outside of  
unicode's "private use area" looks promising as only pathological  
symbol fonts should be impacted by such a change.

---
Herbert Duerr
[hidden email]

Registered Office: Sun Microsystems GmbH
   Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Commercial register of the Local Court of Munich: HRB 161028
Managing Directors: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Chairman of the Supervisory Board: Martin Haering

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]