Load settings from a configuration file, allow customizing the output PDF font#58
Open
lenormf wants to merge 2 commits intovilcans:masterfrom
Open
Load settings from a configuration file, allow customizing the output PDF font#58lenormf wants to merge 2 commits intovilcans:masterfrom
lenormf wants to merge 2 commits intovilcans:masterfrom
Conversation
Owner
|
Thanks for this! I haven't tested it manually yet, but the test script |
Author
|
I'll fix the linting errors (I didn't get any with |
This commit allows settings to be loaded from a configuration
file. If one exists at `$XDG_CONFIG_HOME/screenplain/screenplain.cfg`
(by default), it will be loaded.
A new `-c`/`--config` command line flag allows loading a configuration
file explicitly. Command line options take precedence over the settings
loaded from the configuration file.
The format of the file is INI, with no interpolations, options without
values are allowed, and double-bracketed "sub-sections" (aesthetics
only, the hierarchy of such sections in relation with "root-level"
sections is not enforced).
An example of a configuration file would be:
```ini
[export]
format: pdf
[[pdf]]
strong: no
[[html]]
base: no
css
```
This commit allows the configuration file to declare custom fonts to
be used, when exporting a PDF file.
The functionality could probably be extended to HTML exports.
Example that sets "Courier Prime" as default font:
```ini
[export]
format: pdf
[[pdf]]
strong: no
font: courier_prime
[font]
[[courier_prime]]
name: Courier Prime
regular: ["Courier Prime", "courier-prime.ttf"]
bold: ["Courier Prime Bold", "courier-prime-bold.ttf"]
italic: ["Courier Prime Italic", "courier-prime-italic.ttf"]
bold_italic: ["Courier Prime Bold Italic", "courier-prime-bold-italic.ttf"]
```
Author
|
Linting warning fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35.