Skip to content

Commit

Permalink
added description of default rendering font; added additional variabl…
Browse files Browse the repository at this point in the history
…es to the Jinja2 preprocessor description
  • Loading branch information
jhpyle committed Oct 25, 2023
1 parent 271a3e6 commit 89d0287
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
26 changes: 26 additions & 0 deletions _docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ layout: docs
title: Change Log
short_title: Change Log
---
## [1.4.83](https://github.com/jhpyle/docassemble/releases/tag/v1.4.83) - 2023-10-25


### Added
- The `default rendering font` Configuration directive. This allows
you to specify a system-wide font that should be used for rendering
form fields when using an `attachment` with `pdf template file` and
`editable: False`.


### Changed
- The feature from 1.4.79, described below as "`pdftk` will render
form fields to text using the `msttcorefonts` version of Arial,
which has better support for Unicode characters," has been removed
because with this font, `pdftk` rendered text too small when the
font size in the field was "Auto." To reenable this feature, specify
a `default rendering font` in your Configuration, or specify a
`rendering font` with each attachment.


### Fixed
- Error when non-`str` values are used as `datatype: checkboxes`
values.
- The `css class` of a `question` persisted after the Continue button
was pressed.

## [1.4.82](https://github.com/jhpyle/docassemble/releases/tag/v1.4.82) - 2023-10-15


Expand Down
20 changes: 20 additions & 0 deletions _docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -4651,6 +4651,24 @@ tagged pdf: True
This setting can also be made on a per-interview basis by setting the
[`tagged pdf` features setting].

## <a name="default rendering font"></a>Changing the default font for rendering PDF fields

When `pdf template file` is used with `editable: False`, [pdftk] is
used to convert form fields to rendered text. The default font that
[pdftk] uses may not have support for characters that you want to
use. You can specify a different font for a particular `attachment`
using [`rendering font`].

To specify a font that should be used by default instead of [pdftk]'s
Arial font, you can specify a `default rendering font` in the
Configuration.

{% highlight yaml %}
default rendering font: /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
{% endhighlight %}

For more information about what font file to use, see [`rendering font`].

## <a name="enable unoconv"></a>Using unoconv instead of LibreOffice for processing DOCX files

Starting with system version 1.3.18, a [unoconv] listener is
Expand Down Expand Up @@ -6540,3 +6558,5 @@ and Facebook API keys.
[`GOTENBERGURL`]: {{ site.baseurl }}/docs/docker.html#GOTENBERGURL
[`grid` field modifier]: {{ site.baseurl }}/docs/fields.html#grid
[`password login`]: #password login
[pdftk]: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
[`rendering font`]: {{ site.baseurl }}/docs/documents.html#rendering font
12 changes: 12 additions & 0 deletions _docs/initial.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,17 @@ referring to their package names. E.g.,
`questions.yml` in the `docassemble/helloworld/data/questions`
directory of that package.

The `include` block is a special type of block that is only evaluated
when the YAML is initially compiled. Modifiers like `if` and
`mandatory` have no effect on the `include` block. It is not possible
to conditionally include a YAML file because `include` is a
"compile-time" block, not a "runtime" block. If you want the blocks
inside of the included YAML file to be conditionally applicable, you
need to use `if` or `mandatory` modifiers on those blocks.

See the section on [combining multiple interviews into one] for
strategies about how to use `include` effectively.

# <a name="im"></a>Images

## <a name="image sets"></a>With attribution: `image sets`
Expand Down Expand Up @@ -2792,3 +2803,4 @@ This will cause the web application to run the JavaScript for the
[`pickle`]: https://docs.python.org/3/library/pickle.html
[`mail`]: {{ site.baseurl }}/docs/config.html#mail multiple
[GitHub repository]: {{ site.github.repository_url }}
[combining multiple interviews into one]: {{ site.baseurl }}/docs/logic.html#multiple interviews
6 changes: 6 additions & 0 deletions _docs/interviews.md
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,10 @@ The following variables are available in the [Jinja2] context:
[`include` block]. Otherwise, `__parent_filename__` will be the
same as `__interview_filename__`.
* `__parent_package__`: the package containing `__parent_filename`.
* `__debug__`: the value of the [`debug`] Configuration directive (the
default is `True`.
* `__hostname__`: the value of the [`external hostname`] Configuration
directive (the default is `localhost`).

In addition, you can make variables available in the [Jinja2] context on
your server by setting the [`jinja data`] directive in your
Expand Down Expand Up @@ -1173,3 +1177,5 @@ containing `# use jinja` was encountered.
[`SQLObject`]: {{ site.baseurl }}/docs/objects.html#SQLObject
[`allow embedding`]: {{ site.baseurl }}/docs/config.html#allow embedding
[Jinja2]: https://jinja.palletsprojects.com/en/3.0.x/
[`debug`]: {{ site.baseurl }}/docs/config.html#debug
[`external hostname`]: {{ site.baseurl }}/docs/config.html#external hostname

0 comments on commit 89d0287

Please sign in to comment.