mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
Document symbol fonts hack (text from Georg Baum).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17368 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b242a84807
commit
a7d8653a46
@ -93,6 +93,10 @@ int GuiFontMetrics::width(docstring const & s) const
|
||||
}
|
||||
|
||||
if (smallcaps_shape_)
|
||||
// Caution: The following ucs4 to QString conversions work
|
||||
// for symbol fonts only because they are no real conversions
|
||||
// but simple casts in reality. See comment in QLPainter::text()
|
||||
// for more explanation.
|
||||
return smallcapsWidth(toqstr(s));
|
||||
|
||||
int w = 0;
|
||||
|
@ -207,6 +207,17 @@ int QLPainter::smallCapsText(int x, int y,
|
||||
int QLPainter::text(int x, int y, docstring const & s,
|
||||
LyXFont const & f)
|
||||
{
|
||||
/* Caution: The following ucs4 to QString conversions work for symbol fonts
|
||||
only because they are no real conversions but simple casts in reality.
|
||||
When we want to draw a symbol or calculate the metrics we pass the position
|
||||
of the symbol in the font (as given in lib/symbols) as a char_type to the
|
||||
frontend. This is just wrong, because the symbol is no UCS4 character at
|
||||
all. You can think of this number as the code point of the symbol in a
|
||||
custom symbol encoding. It works because this char_type is lateron again
|
||||
interpreted as a position in the font again.
|
||||
The correct solution would be to have extra functions for symbols, but that
|
||||
would require to duplicate a lot of frontend and mathed support code.
|
||||
*/
|
||||
QString str = toqstr(s);
|
||||
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user