BerndGabriel / HtmlViewer

The well-known Delphi/Lazarus HtmlViewer/FrameViewer
Other
395 stars 147 forks source link

Is font embedding supported? #322

Closed Dingo64 closed 1 year ago

Dingo64 commented 2 years ago

I tried to render this code but seems font embedding this way is not supported. Is there any other way to use fonts which are not installed on the system?

<style>
@font-face 
{
    font-family: Manrope;
    src: url(Manrope-Regular.ttf);
}
body
{
    font-family: Manrope;
}
</style>

I added some code to my Lazarus project and now I can use custom fonts but would be nice to do that from CSS.

  AddFontResource('Manrope.ttf');
  SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);    
BerndGabriel commented 2 years ago

HtmlViewer does not support fonts other than those installed on the system.