开发者

Using .eot embedded Font with Net Framework WebBrowser control

开发者 https://www.devze.com 2023-03-30 01:13 出处:网络
My application should display html page in Net Framework WebBrowser control.One of requirements is that page should be displayed with custom font.The only way of doing 开发者_Python百科it is to use .e

My application should display html page in Net Framework WebBrowser control.One of requirements is that page should be displayed with custom font.The only way of doing 开发者_Python百科it is to use .eot embedded font. I have prepared the font file and page is displaying HTML with my custom font using CSS.

@font-face
{
    font-family: myfontfamily;
    src: file('d:\myfontfamily.eot');
}

p
{
font-family: myfontfamily;
}

while I am using it as ordinary html page saved on disk and viewing in IE it's ok.But my page is not saved on disk,I pass the HTML as string,and even images and styles are passed to browser control "on fly". How can I pass that font file to browser control,it's desired that .eot file can be passed without saving on the disk.Can it be done so ?


I found a satisfying solution for that matter. You need to install this font on your computer. Check out this page: http://www.eaglefonts.com/how-to-install-truetype-font.php . It explains how to install a font on varius platforms. For example, on windows 7, double click your 'myfontfamily.eot' file and click install.

Now the web browser will use that custom font, but obviously it will work only on your computer.

0

精彩评论

暂无评论...
验证码 换一张
取 消