diff --git a/CHANGELOG.md b/CHANGELOG.md index 6688a43c..0314865c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ ### Changed * [HexaPDF::Type::AcroForm::Form] text-like field creation methods to always set - a default appearance string + a default appearance string and the quadding * Convenience methods for accessing resources to not add the deprecated /ProcSet entry by default * [HexaPDF::DigitalSignature::CMSHandler] to add informational output regarding diff --git a/lib/hexapdf/type/acro_form/form.rb b/lib/hexapdf/type/acro_form/form.rb index dcecaee8..26223616 100644 --- a/lib/hexapdf/type/acro_form/form.rb +++ b/lib/hexapdf/type/acro_form/form.rb @@ -558,7 +558,7 @@ def apply_variable_text_properties(field, font: nil, font_options: nil, font_siz font_options: font_options || {}, font_size: font_size || 0, font_color: font_color || 0) - field.text_alignment(align) if align + field.text_alignment(align || :left) end def perform_validation # :nodoc: diff --git a/test/hexapdf/type/acro_form/test_form.rb b/test/hexapdf/type/acro_form/test_form.rb index c9dfd34e..e04942f8 100644 --- a/test/hexapdf/type/acro_form/test_form.rb +++ b/test/hexapdf/type/acro_form/test_form.rb @@ -164,6 +164,7 @@ def applies_variable_text_properties(method, **args) assert_equal(:'Helvetica', @acro_form.default_resources.font(font_name)[:BaseFont]) assert_equal(0, font_size) assert_equal(HexaPDF::Content::ColorSpace::DeviceGray.new.color(0), font_color) + assert_equal(0, field.value[:Q]) field = @acro_form.send(method, "field", **args, font: 'Times') font_name, font_size, font_color = field.parse_default_appearance_string