C# Класс Bloom.Publish.FontFileFinder

This class handles the problem of finding what files contain the definition of the various faces of a particular font. So far the best approach involves a scan of the whole font directory, so it is much more efficient to build a dictionary once, or at least once per operation that uses it. The dictionary and method could be static, but then, we would miss the chance to find any new fonts added since the last operation that needed this information.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
FindLinuxFonts IEnumerable
FindLinuxFonts IEnumerable

Открытые методы

Метод Описание
GetFilesForFont ( string fontName ) : IEnumerable

This is really hard. We somehow need to figure out what font file(s) are used for a particular font. http://stackoverflow.com/questions/16769758/get-a-font-filename-based-on-the-font-handle-hfont has some ideas; the result would be Windows-specific. And at some point we should ideally consider what faces are needed. For now we use brute force. 'Andika New Basic' -> AndikaNewBasic-{R,B,I,BI}.ttf Arial -> arial.ttf/ariali.ttf/arialbd.ttf/arialbi.ttf 'Charis SIL' -> CharisSIL{R,B,I,BI}.ttf (note: no hyphen) Doulos SIL -> DoulosSILR

GetGroupForFont ( string fontName ) : FontGroup

Приватные методы

Метод Описание
FindLinuxFonts ( ) : IEnumerable
FindLinuxFonts ( string folder ) : IEnumerable

Описание методов

GetFilesForFont() публичный Метод

This is really hard. We somehow need to figure out what font file(s) are used for a particular font. http://stackoverflow.com/questions/16769758/get-a-font-filename-based-on-the-font-handle-hfont has some ideas; the result would be Windows-specific. And at some point we should ideally consider what faces are needed. For now we use brute force. 'Andika New Basic' -> AndikaNewBasic-{R,B,I,BI}.ttf Arial -> arial.ttf/ariali.ttf/arialbd.ttf/arialbi.ttf 'Charis SIL' -> CharisSIL{R,B,I,BI}.ttf (note: no hyphen) Doulos SIL -> DoulosSILR
public GetFilesForFont ( string fontName ) : IEnumerable
fontName string
Результат IEnumerable

GetGroupForFont() публичный Метод

public GetGroupForFont ( string fontName ) : FontGroup
fontName string
Результат FontGroup