Infer.Font (Infer v0.1.1) View Source

Font type matchers based on the magic number

Link to this section Summary

Functions

Takes the binary file contents as arguments. Returns true if it's a otf font.

Takes the binary file contents as arguments. Returns true if it's a ttf font.

Takes the binary file contents as arguments. Returns true if it's a woff font.

Takes the binary file contents as arguments. Returns true if it's a woff2 font.

Link to this section Functions

Specs

is_otf(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a otf font.

Specs

is_ttf(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a ttf font.

Examples

iex> binary = File.read!("test/fonts/sample.ttf")
iex> Infer.Font.is_ttf(binary)
true

Specs

is_woff(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a woff font.

Specs

is_woff2(binary()) :: boolean()

Takes the binary file contents as arguments. Returns true if it's a woff2 font.