Exemplo n.º 1
0
 public Font(FontFamily family, int size, bool italic, Amity.FontWeight weight)
 {
     Size    = size;
     FontPtr = CreateFontIndirectW(new LOGFONTW
     {
         lfCharSet  = FontCharSet.DEFAULT_CHARSET,
         lfFaceName = family.Name,
         lfHeight   = (int)size,
         lfItalic   = italic,
         lfWeight   = FontWeight.FW_MEDIUM + (100 * (int)weight)
     });
     ThrowError(GetTextMetricsW(family.HDC, out var lptm) == false);
     Ascent  = lptm.tmAscent;
     Descent = lptm.tmDescent;
 }
Exemplo n.º 2
0
 public IFont GetFont(float size, FontSlant slant, Amity.FontWeight weight)
 {
     return(new Font(this, (int)size, slant != FontSlant.Roman, weight));
 }