File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -133,13 +133,13 @@ defmodule Mudbrick.TextBlock.Output do
133
133
end
134
134
135
135
def with_font ( output , op , part ) do
136
- if part . font == nil or output . font == part . font do
136
+ if part . font in [ nil , output . font ] and part . font_size == nil do
137
137
add ( output , op )
138
138
else
139
139
output
140
140
|> add ( % Tf { font: output . font , size: output . font_size } )
141
141
|> add ( op )
142
- |> add ( % Tf { font: part . font , size: output . font_size } )
142
+ |> add ( % Tf { font: part . font || output . font , size: part . font_size || output . font_size } )
143
143
end
144
144
end
145
145
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ defmodule Mudbrick.TextBlockTest do
117
117
"12.0 TL" ,
118
118
"400 500 Td" ,
119
119
"0 0 0 rg" ,
120
+ "/F1 14 Tf" ,
120
121
"<011D00D500D9011601B700D9011601B7> Tj" ,
122
+ "/F1 10 Tf" ,
121
123
"/F2 10 Tf" ,
122
124
"<00B400FC00ED00BB01B7> Tj" ,
123
125
"/F1 10 Tf" ,
@@ -133,7 +135,7 @@ defmodule Mudbrick.TextBlockTest do
133
135
font_size: 10 ,
134
136
position: { 400 , 500 }
135
137
)
136
- |> TextBlock . write ( "this is " )
138
+ |> TextBlock . write ( "this is " , font_size: 14 )
137
139
|> TextBlock . write ( "bold " , font: bold )
138
140
|> TextBlock . write ( "but this isn't " )
139
141
|> TextBlock . write ( "this is franklin" , font: franklin )
You can’t perform that action at this time.
0 commit comments