Hi,
While trying to get some chinese characters to render properly I ran into an issue with princexml.
I have installed the arphic fonts and this works correctly when using css like "font-family: verdana, sans-serif" or "font-family: verdana, AR PL UKai CN".
However it fails when only using "font-family: verdana", this is not expected since all browsers render it fine.
My initial work-around was using a @font-face rule like this:
However this caused all verdana text to be rendered in the ukai font. To mitigate this issue I tried to use the unicode-range css property.
However this caused all "normal" text to be rendered in Times new roman instead of Verdana.
This feels as a bug, as I only expect it to influence characters specified in the unicode-range.
I tried to add an extra rule to use the local Verdana font
However this caused a 'cyclic @font-face redirect to "Verdana"' warning and still resulted in using Times new roman.
My final workaround was to directly refer to location of the font on our servers, this works but it feels as a very dirty hack:
Is there a better way to solve this? (ideally this should work as in all browsers, so without specifying any @font-face rule)
While trying to get some chinese characters to render properly I ran into an issue with princexml.
I have installed the arphic fonts and this works correctly when using css like "font-family: verdana, sans-serif" or "font-family: verdana, AR PL UKai CN".
However it fails when only using "font-family: verdana", this is not expected since all browsers render it fine.
My initial work-around was using a @font-face rule like this:
@font-face
{
font-family: verdana;
src: local("AR PL UKai CN"), local("AR PL KaitiM GB"); /* Chinese */
}
However this caused all verdana text to be rendered in the ukai font. To mitigate this issue I tried to use the unicode-range css property.
@font-face
{
font-family: verdana;
src: local("AR PL UKai CN"), local("AR PL KaitiM GB"); /* Chinese */
unicode-range: U+4E00-9FCC, U+3000-303F, U+FF00-FFEF;
}
However this caused all "normal" text to be rendered in Times new roman instead of Verdana.
This feels as a bug, as I only expect it to influence characters specified in the unicode-range.
I tried to add an extra rule to use the local Verdana font
@font-face
{
font-family: verdana;
src: local("AR PL UKai CN"), local("AR PL KaitiM GB"); /* Chinese */
unicode-range: U+4E00-9FCC, U+3000-303F, U+FF00-FFEF;
}
@font-face
{
font-family: verdana;
src: local("Verdana")
}
However this caused a 'cyclic @font-face redirect to "Verdana"' warning and still resulted in using Times new roman.
My final workaround was to directly refer to location of the font on our servers, this works but it feels as a very dirty hack:
@font-face
{
font-family: verdana;
src: local("AR PL UKai CN"), local("AR PL KaitiM GB"); /* Chinese */
unicode-range: U+4E00-9FCC, U+3000-303F, U+FF00-FFEF;
}
@font-face
{
font-family: verdana;
font-weight: bold;
src: url("/data/www/fonts/verdanab.ttf");
}
@font-face
{
font-family: verdana;
font-weight: normal;
src: url("/data/www/fonts/verdana.ttf");
}
@font-face
{
font-family: verdana;
font-style: italic;
src: url("/data/www/fonts/verdanai.ttf");
}
Is there a better way to solve this? (ideally this should work as in all browsers, so without specifying any @font-face rule)