View Source Infer.Font (Infer v0.2.6)

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 woff2 font.

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

Link to this section Functions

Specs

otf?(binary()) :: boolean()

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

Specs

ttf?(binary()) :: boolean()

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

examples

Examples

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

Specs

woff2?(binary()) :: boolean()

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

Specs

woff?(binary()) :: boolean()

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