Skip to content

Commit

Permalink
Hardcode Identity-H encoding for now
Browse files Browse the repository at this point in the history
When the user provides a file, we draw the glyphs directly, rather than
using a regular encoding system.
  • Loading branch information
camelpunch committed Oct 14, 2024
1 parent 448b4e3 commit 0240b9a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
1 change: 1 addition & 0 deletions lib/mudbrick/font.ex
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ defmodule Mudbrick.Font do
&Font.new(
Keyword.merge(font_opts,
descendant: &1,
encoding: :"Identity-H",
name: font_name,
parsed: opentype
)
Expand Down
9 changes: 1 addition & 8 deletions test/mudbrick/font_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ defmodule Mudbrick.FontTest do

{doc, _} =
Mudbrick.new()
|> Mudbrick.page(
fonts: %{
bodoni: [
encoding: :"Identity-H",
file: data
]
}
)
|> Mudbrick.page(fonts: %{bodoni: [file: data]})

[_, font | _] = doc.objects

Expand Down
7 changes: 1 addition & 6 deletions test/mudbrick_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ defmodule MudbrickTest do
assert new()
|> page(
size: :letter,
fonts: %{
bodoni: [
file: data,
encoding: :"Identity-H"
]
}
fonts: %{bodoni: [file: data]}
)
|> contents()
|> font(:bodoni, size: 13)
Expand Down

0 comments on commit 0240b9a

Please sign in to comment.