NLdoc.Conversion.Reader.Docx.AST.Fonts (NLdoc.Conversion.Reader.Docx v1.1.2)
View SourceThis module defines a struct that represents a w:rFonts
object in a Word document.
Summary
Types
This type defines special fonts that won't render properly on the web and will need conversion to UTF-8.
Functions
Given a special font type or special font name, returns a module that implements NLdoc.Conversion.Reader.Docx.AST.Fonts.FontBehaviour
for converting characters in that font to UTF-8.
Returns true for font types or font names that are special fonts, i.e. they won't render properly on the web and will need conversion to UTF-8.
Types
@type special_font() :: :wingdings | :wingdings2 | :wingdings3 | :webdings | :symbol
This type defines special fonts that won't render properly on the web and will need conversion to UTF-8.
Functions
@spec font(special_font() | String.t()) :: NLdoc.Conversion.Reader.Docx.AST.Fonts.Wingdings | NLdoc.Conversion.Reader.Docx.AST.Fonts.Wingdings2 | NLdoc.Conversion.Reader.Docx.AST.Fonts.Wingdings3 | NLdoc.Conversion.Reader.Docx.AST.Fonts.Webdings | NLdoc.Conversion.Reader.Docx.AST.Fonts.Symbol | NLdoc.Conversion.Reader.Docx.AST.Fonts.UTF8
Given a special font type or special font name, returns a module that implements NLdoc.Conversion.Reader.Docx.AST.Fonts.FontBehaviour
for converting characters in that font to UTF-8.
Returns true for font types or font names that are special fonts, i.e. they won't render properly on the web and will need conversion to UTF-8.
Can also be used as a guard clause.
Examples
iex> import NLdoc.Conversion.Reader.Docx.AST.Fonts, only: [is_special_font: 1]
iex>
iex> is_special_font(:wingdings)
true
iex> is_special_font(:wingdings2)
true
iex> is_special_font(:wingdings3)
true
iex> is_special_font(:webdings)
true
iex> is_special_font(:symbol)
true
iex> is_special_font("Wingdings")
true
iex> is_special_font("Wingdings 2")
true
iex> is_special_font("Wingdings 3")
true
iex> is_special_font("Webdings")
true
iex> is_special_font("Symbol")
true
iex> is_special_font(:utf8)
false
iex> is_special_font("UTF8")
false