diff options
author | Jaakko KeraΜnen <jaakko.keranen@iki.fi> | 2022-01-03 07:34:59 +0200 |
---|---|---|
committer | Jaakko KeraΜnen <jaakko.keranen@iki.fi> | 2022-01-03 07:34:59 +0200 |
commit | 0d1bc0e469e8ca4b2cd3d269974c964e0f2916b0 (patch) | |
tree | 69100508eab6ab08391664f93eda748d1be90c5c /res/about | |
parent | f975714ca43f668d72eed26ea1a90de3991430b8 (diff) |
Mobile: Updated Help
Diffstat (limited to 'res/about')
-rw-r--r-- | res/about/android-help.gmi | 128 | ||||
-rw-r--r-- | res/about/android-version.gmi | 2 | ||||
-rw-r--r-- | res/about/help.gmi | 4 | ||||
-rw-r--r-- | res/about/ios-help.gmi | 157 |
4 files changed, 287 insertions, 4 deletions
diff --git a/res/about/android-help.gmi b/res/about/android-help.gmi index 1425b6bc..48835967 100644 --- a/res/about/android-help.gmi +++ b/res/about/android-help.gmi | |||
@@ -32,7 +32,6 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a | |||
32 | * Freely adjustable scaling factor for the UI | 32 | * Freely adjustable scaling factor for the UI |
33 | * Sidebar for managing bookmarks, subscribed feeds, and viewing browsing history and the page outline | 33 | * Sidebar for managing bookmarks, subscribed feeds, and viewing browsing history and the page outline |
34 | * Multiple tabs | 34 | * Multiple tabs |
35 | * Split view for browsing two pages at once (iPad only) | ||
36 | * Find text on the page | 35 | * Find text on the page |
37 | * Open image and audio links inline on the same page | 36 | * Open image and audio links inline on the same page |
38 | * Smart suggestions when typing an URL β search bookmarks, history, identities | 37 | * Smart suggestions when typing an URL β search bookmarks, history, identities |
@@ -45,3 +44,130 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a | |||
45 | * Built-in support for Gopher | 44 | * Built-in support for Gopher |
46 | * Built-in support for uploading data using the Titan protocol | 45 | * Built-in support for uploading data using the Titan protocol |
47 | * Use proxy servers for HTTP, Gopher, or Gemini content | 46 | * Use proxy servers for HTTP, Gopher, or Gemini content |
47 | |||
48 | # Work in progress! | ||
49 | |||
50 | This documentation is a work in progress. You may find it useful to alse see the desktop Help page: | ||
51 | => gemini://git.skyjake.fi:1968/lagrange/release/res/about/help.gmi Help page (desktop version, latest release) | ||
52 | |||
53 | # 1 User interface | ||
54 | |||
55 | ## 1.6 Identities (client certificates) | ||
56 | |||
57 | Gemini uses TLS client certificates for user/session identification purposes. Unlike on the web where user identity tracking is covert and automatic, client certificates must be manually taken into use, and you are able to define how long each certificate remains valid. The term "Identity" is used in Lagrange to refer to client certificates. | ||
58 | |||
59 | The Identities sidebar tab shows all identities known to Lagrange. This includes identities created in Lagrange and any identities based on imported X.509 certificates. | ||
60 | |||
61 | ### 1.6.1 Creating a new identity | ||
62 | |||
63 | Click on the π€ button in the toolbar and select "New Identity...". | ||
64 | |||
65 | Consider any information you enter in the certificate as public β only the Common Name is required to be non-empty. The generated certificate will use the Common Name as the issuer and subject of the certificate, making it clear that the certificate is self-signed. The other required field is the expiration date in "Valid until". Entering a year is sufficient, and means that the certificate is valid until the end of that year. | ||
66 | |||
67 | ### 1.6.2 Using an identity | ||
68 | |||
69 | You will need to select an identity when you encounter this error message: | ||
70 | |||
71 | > π Certificate Required | ||
72 | |||
73 | Go to Settings > Identities and tap on an identity to toggle it on/off for the currently open URL. On subsequent page loads, the certificate will then be sent to the server when the URL or any URL under it is fetched. You can click on the π€ button in the navigation bar to see which identity is being used for the current page. | ||
74 | |||
75 | As the sidebar is not keyboard-navigable, note that identities can also be accessed via lookup results. Identities matching the search terms are shown as the last category in the lookup results list. From there, one can toggle an identity for the current page, or stop using it on all pages. | ||
76 | |||
77 | ### 1.6.3 Importing existing certificates | ||
78 | |||
79 | To import an existing X.509 certificate as an identity, click on π€ and select "Import...". | ||
80 | |||
81 | When the Import Identity dialog opens, it checks the currently open page and the system clipboard for any certificates and private keys in PEM format. If found, these are automatically loaded in. | ||
82 | |||
83 | ## 1.8 Uploads (with Titan) | ||
84 | |||
85 | Titan is a sister protocol to Gemini that enables sending arbitrary amounts of data from a client to a server. The Gemini protocol itself only enables sending up to 1024 bytes of data in a request. Furthermore, the request URL also counts against that limit, and the sent data must be percent-encoded so it can be parsed as a valid URL. Consequently, Gemini clients can only send very limited amounts of data to a server. Titan solves this by expanding the request so that the request URL is followed by a payload field. When it comes to TLS, Titan is equivalent to Gemini, so the same server and client certificates can be used with both. | ||
86 | |||
87 | => gemini://transjovian.org/titan Titan Protocol (by Alex Schroeder) | ||
88 | |||
89 | While Titan and Gemini are related, Titan is a separate protocol and regular Gemini servers are not expected to support it. Whether it makes sense to allow clients to upload large amounts of data is a service-specific question. For example, a server that hosts a gemlog could enable Titan uploads for submitting new posts, or editing existing posts by uploading a revised version. | ||
90 | |||
91 | As far as Lagrange is concerned, Titan is just one of the supported URL schemes. Whenever you try to open a "titan://" URL, no matter if it is manually entered into the URL field, or by clicking on a link, opening a bookmark, feed entry, or via a redirect, a dialog will open where you can specify the data to upload. | ||
92 | |||
93 | The Titan upload dialog supports two ways to enter the data: | ||
94 | |||
95 | * You can type text in the input field on the "Text" tab. It will be sent to the server using 'text/plain' as the media type. | ||
96 | * You can drag and drop a file on the dialog. The details of the file to be uploaded are visible on the "File" tab. The media type can be specified manually if Lagrange does not correctly detect it. | ||
97 | |||
98 | The upload token is a feature of Titan where servers can require a certain token text/passphrase for uploads. It is up to the server how this is interpreted. It could be used as a simple password, or even a command to further instruct the server about what to do with the uploaded data. Please refer to the server's instructions about what to enter here. The token may also be left empty. | ||
99 | |||
100 | The text entered into the upload dialog's main text field is protected against accidental closing of the dialog or the application, or a crash. The previous text is restored when the dialog is reopened. The text field contents are only cleared when the submitted Titan request has been successfully completed. | ||
101 | |||
102 | # 2 Customization | ||
103 | |||
104 | ## 2.1 Browsing behavior | ||
105 | |||
106 | The "Open archive indices" option controls whether index.gmi pages are automatically opened while browsing the contents of a ZIP archive. The purpose is to simulate the behavior of a Gemini server where opening a directory will by default show its index page. Enabling this option makes navigating an archived copy of a capsule a more streamlined experience. | ||
107 | |||
108 | ## 2.4 Fonts | ||
109 | |||
110 | This version of Lagrange supports TrueType fonts. To use a new font, simply view a .ttf (or .fontpack) file in the app and a page footer action is available for performing the installation. | ||
111 | |||
112 | The "Fonts" page of Settings contains options that affect the appearance of text in page content, the user interface, and text rendering in general. | ||
113 | |||
114 | To be precise, on this tab you can select which _typefaces_ to use for certain elements of the page and the UI; picking a particular font (including its size, weight, style, etc.) for specific elements is not possible. Lagrange controls the size and styling of text by choosing fonts according to your theme and typeface preferences. The term "font" is often used to mean "typeface" in this document and in the app UI. | ||
115 | |||
116 | The fonts for document headings, body text, preformatted blocks, and the user interface can be chosen separately. There is also a separate font for monospaced body text, used when the protocol-specific "Monospace body" option is enabled. | ||
117 | |||
118 | There are two built-in fonts available: | ||
119 | |||
120 | * "Source Sans" is the default UI font that is also used for page content. | ||
121 | * "Iosevka" is the monospaced font. | ||
122 | |||
123 | There is also an "Iosevka (compact)" variant that actually uses the font's original line spacing. It is the default for preformatted blocks to avoid gaps between lines of ASCII art, but not for body text for better legibility. | ||
124 | |||
125 | See sections 2.4.4 and 5 for more details about font management, compatibility, and configuration. | ||
126 | |||
127 | ### 2.4.1 Monospace body | ||
128 | |||
129 | The "Monospace body" option causes all pages to be displayed in a monospace font. For example, most Gopher content has been written with the assumption of a monospace font, so it may provide a better reading experience to enable this for Gopher pages. The selected "Monospace font" is applied to the entire document. | ||
130 | |||
131 | Handling of whitespace in page content also changes when this option is enabled: spaces are no longer normalized so if the source uses multiple spaces somewhere, those are shown as-is. | ||
132 | |||
133 | ### 2.4.2 ANSI escapes | ||
134 | |||
135 | => https://en.wikipedia.org/wiki/ANSI_escape_code ANSI escape code (Wikipedia): | ||
136 | > ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. | ||
137 | |||
138 | Sometimes these codes are used for things like colored ASCII art. However, Lagrange is not a terminal emulator so only a very minimal set of codes have any effect; the rest are ignored. | ||
139 | |||
140 | The "ANSI escapes" setting controls which ANSI escape codes are enabled: | ||
141 | |||
142 | * "FG Color" enables changes to text foreground color. | ||
143 | * "BG Color" enables changes to text background color. | ||
144 | * "Font Style" enables changing the font style: bold, italic, or monospace. (These correspond to codes 1, 3, and 11.) | ||
145 | |||
146 | A warning banner is displayed if any codes are detected on a page. This helps you be aware of potential visual artifacts, like text color that is being forced to black regardless of the page background color. Click on the warning to dismiss it on a per-site basis. | ||
147 | |||
148 | If you serve content via Gemini, please be aware that ANSI escapes may not be supported by clients, and may in fact disrupt the behavior of a client in unexpected ways. For instance, consider a screen reader or a web proxy that doesn't filter out the codes. Only employ ANSI escapes when the user has somehow indicated that is their preference. | ||
149 | |||
150 | ### 2.4.3 Other font options | ||
151 | |||
152 | The "Glyph warnings" option controls whether a warning will be shown when a page is missing one or more characters. This is typically due to the page being in a language that is not covered by any of the installed fonts. Clicking on the glyph warning banner opens the font management page. | ||
153 | |||
154 | "Smoothing" enables or disables glyph antialiasing. In this version, it is recommended that smoothing is always enabled. This is because the text renderer does not support hinting of any kind, which means that without smoothing, glyph shapes will be severely distorted. You may still want to try disabling this option if antialiasing causes eye strain for you. | ||
155 | |||
156 | ### 2.4.4 Managing fonts | ||
157 | |||
158 | Open "about:fonts" to see all the installed fonts, and enable, disable or uninstall individual fontpacks. At the top of the page, there is a link to the skyjake.fi Font Library: a curated collection of fontpacks that can be freely distributed. From there you can conveniently install more fonts specifically tuned for Lagrange. | ||
159 | |||
160 | The rest of the page is divided to two sections: enabled and disabled fontpacks. Individual packs can be disabled, so they remain installed but not in use. (Tip: Use the Outline sidebar to see a list of all packs, if there are many.) | ||
161 | |||
162 | Click on the "View file" links to see what each fontpack contains. The fontpack format is described in section 5: it is simply a ZIP archive with some metadata and a bunch of font files. When you install a TrueType font (i.e., copy it to the user's fonts directory), it is treated as a fontpack containing a single file, although no ZIP archive is created for it. Use the "View fontpack.ini template" link to see the generated metadata that can be used as a basis for creating an actual fontpack. | ||
163 | |||
164 | About compatibility: fonts are complex, and while the TrueType format is not the most advanced one, it still has features that are not supported in Lagrange. The technical reason is that glyphs are rasterized using stb_truetype, a rather simple TrueType font library. (It's nice and small, though.) You may find that some fonts simply fail to load correctly, or look wrong in the app. | ||
165 | |||
166 | * Hinting is not supported. | ||
167 | * Bitmap glyphs are not supported. | ||
168 | * Multi-color glyphs are not supported. | ||
169 | |||
170 | TrueType Collections (.ttc) can be used, with the restriction that each declared font uses a single index from the collection. The index must be appended to the file name: | ||
171 | ```.ttc example | ||
172 | regular = "NotoSansCJK-Regular.ttc:2" | ||
173 | ``` | ||
diff --git a/res/about/android-version.gmi b/res/about/android-version.gmi index a7b87d47..610e35b0 100644 --- a/res/about/android-version.gmi +++ b/res/about/android-version.gmi | |||
@@ -15,7 +15,7 @@ | |||
15 | * Fixed system Auto-Rotate setting not locking the screen orientation. | 15 | * Fixed system Auto-Rotate setting not locking the screen orientation. |
16 | 16 | ||
17 | ## 1.10 (Alpha 2) | 17 | ## 1.10 (Alpha 2) |
18 | * Upgraded SDL to 2.0.8, which fixed a lot of stability issues. | 18 | * Upgraded SDL to 2.0.18, which fixed a lot of stability issues. |
19 | * Added native binaries for arm64, x86, and x86_64. | 19 | * Added native binaries for arm64, x86, and x86_64. |
20 | * Enabled bidirectional text and complex scripts (with HarfBuzz and FriBidi). | 20 | * Enabled bidirectional text and complex scripts (with HarfBuzz and FriBidi). |
21 | * Enabled switching to landscape orientation. | 21 | * Enabled switching to landscape orientation. |
diff --git a/res/about/help.gmi b/res/about/help.gmi index 7c904bd9..b753cb39 100644 --- a/res/about/help.gmi +++ b/res/about/help.gmi | |||
@@ -253,7 +253,7 @@ You will need to select an identity when you encounter this error message: | |||
253 | 253 | ||
254 | > π Certificate Required | 254 | > π Certificate Required |
255 | 255 | ||
256 | Clicking on an identity in the sidebar will toggle it on/off for the currently open URL. On subsequent page loads, the certificate will then be sent to the server when the URL or any URL under it is fetched. You can click on the π€ button in the navigation bar to see which identity is being used for the current page. | 256 | Clicking on an identity in the sidebar shows a menu where you can control usage of the identity for the currently open URL. On subsequent page loads, the certificate will then be sent to the server when the URL or any URL under it is fetched. You can click on the π€ button in the navigation bar to see which identity is being used for the current page. |
257 | 257 | ||
258 | As the sidebar is not keyboard-navigable, note that identities can also be accessed via lookup results. Identities matching the search terms are shown as the last category in the lookup results list. From there, one can toggle an identity for the current page, or stop using it on all pages. | 258 | As the sidebar is not keyboard-navigable, note that identities can also be accessed via lookup results. Identities matching the search terms are shown as the last category in the lookup results list. From there, one can toggle an identity for the current page, or stop using it on all pages. |
259 | 259 | ||
@@ -390,7 +390,7 @@ Page content color themes are selected on the "Colors" tab of Preferences. The " | |||
390 | 390 | ||
391 | ## 2.4 Fonts | 391 | ## 2.4 Fonts |
392 | 392 | ||
393 | This version of Lagrange supports TrueType fonts. To use a new font in the app, simply view the .ttf file in the app and a page footer action is available for performing the installation. For example, try drag-and-dropping a .ttf file on the window. Alternatively, you can manually copy the font to the "fonts" subdirectory of the user-specific configuration directory (see section 3.5). | 393 | This version of Lagrange supports TrueType fonts. To use a new font, simply view a .ttf file in the app and a page footer action is available for performing the installation. For example, try drag-and-dropping a .ttf file on the window. Alternatively, you can manually copy the font to the "fonts" subdirectory of the user-specific configuration directory (see section 3.5). |
394 | 394 | ||
395 | The "Fonts" tab of the Preferences dialog contains options that affect the appearance of text in page content, the user interface, and text rendering in general. | 395 | The "Fonts" tab of the Preferences dialog contains options that affect the appearance of text in page content, the user interface, and text rendering in general. |
396 | 396 | ||
diff --git a/res/about/ios-help.gmi b/res/about/ios-help.gmi index 1425b6bc..41a8445b 100644 --- a/res/about/ios-help.gmi +++ b/res/about/ios-help.gmi | |||
@@ -45,3 +45,160 @@ Like Gemini, Lagrange has been designed with minimalism in mind. It depends on a | |||
45 | * Built-in support for Gopher | 45 | * Built-in support for Gopher |
46 | * Built-in support for uploading data using the Titan protocol | 46 | * Built-in support for uploading data using the Titan protocol |
47 | * Use proxy servers for HTTP, Gopher, or Gemini content | 47 | * Use proxy servers for HTTP, Gopher, or Gemini content |
48 | |||
49 | # Work in progress! | ||
50 | |||
51 | This documentation is a work in progress. You may find it useful to alse see the desktop Help page: | ||
52 | => gemini://git.skyjake.fi:1968/lagrange/release/res/about/help.gmi Help page (desktop version, latest release) | ||
53 | |||
54 | # 1 User interface | ||
55 | |||
56 | ## 1.6 Identities (client certificates) | ||
57 | |||
58 | Gemini uses TLS client certificates for user/session identification purposes. Unlike on the web where user identity tracking is covert and automatic, client certificates must be manually taken into use, and you are able to define how long each certificate remains valid. The term "Identity" is used in Lagrange to refer to client certificates. | ||
59 | |||
60 | The Identities sidebar tab shows all identities known to Lagrange. This includes identities created in Lagrange and any identities based on imported X.509 certificates. | ||
61 | |||
62 | ### 1.6.1 Creating a new identity | ||
63 | |||
64 | Click on the π€ button in the toolbar and select "New Identity...". | ||
65 | |||
66 | Consider any information you enter in the certificate as public β only the Common Name is required to be non-empty. The generated certificate will use the Common Name as the issuer and subject of the certificate, making it clear that the certificate is self-signed. The other required field is the expiration date in "Valid until". Entering a year is sufficient, and means that the certificate is valid until the end of that year. | ||
67 | |||
68 | ### 1.6.2 Using an identity | ||
69 | |||
70 | You will need to select an identity when you encounter this error message: | ||
71 | |||
72 | > π Certificate Required | ||
73 | |||
74 | Go to Settings > Identities and tap on an identity to toggle it on/off for the currently open URL. On subsequent page loads, the certificate will then be sent to the server when the URL or any URL under it is fetched. You can click on the π€ button in the navigation bar to see which identity is being used for the current page. | ||
75 | |||
76 | As the sidebar is not keyboard-navigable, note that identities can also be accessed via lookup results. Identities matching the search terms are shown as the last category in the lookup results list. From there, one can toggle an identity for the current page, or stop using it on all pages. | ||
77 | |||
78 | ### 1.6.3 Importing existing certificates | ||
79 | |||
80 | To import an existing X.509 certificate as an identity, click on π€ and select "Import...". | ||
81 | |||
82 | When the Import Identity dialog opens, it checks the currently open page and the system clipboard for any certificates and private keys in PEM format. If found, these are automatically loaded in. | ||
83 | |||
84 | ## 1.8 Uploads (with Titan) | ||
85 | |||
86 | Titan is a sister protocol to Gemini that enables sending arbitrary amounts of data from a client to a server. The Gemini protocol itself only enables sending up to 1024 bytes of data in a request. Furthermore, the request URL also counts against that limit, and the sent data must be percent-encoded so it can be parsed as a valid URL. Consequently, Gemini clients can only send very limited amounts of data to a server. Titan solves this by expanding the request so that the request URL is followed by a payload field. When it comes to TLS, Titan is equivalent to Gemini, so the same server and client certificates can be used with both. | ||
87 | |||
88 | => gemini://transjovian.org/titan Titan Protocol (by Alex Schroeder) | ||
89 | |||
90 | While Titan and Gemini are related, Titan is a separate protocol and regular Gemini servers are not expected to support it. Whether it makes sense to allow clients to upload large amounts of data is a service-specific question. For example, a server that hosts a gemlog could enable Titan uploads for submitting new posts, or editing existing posts by uploading a revised version. | ||
91 | |||
92 | As far as Lagrange is concerned, Titan is just one of the supported URL schemes. Whenever you try to open a "titan://" URL, no matter if it is manually entered into the URL field, or by clicking on a link, opening a bookmark, feed entry, or via a redirect, a dialog will open where you can specify the data to upload. | ||
93 | |||
94 | The Titan upload dialog supports two ways to enter the data: | ||
95 | |||
96 | * You can type text in the input field on the "Text" tab. It will be sent to the server using 'text/plain' as the media type. | ||
97 | * You can drag and drop a file on the dialog. The details of the file to be uploaded are visible on the "File" tab. The media type can be specified manually if Lagrange does not correctly detect it. | ||
98 | |||
99 | The upload token is a feature of Titan where servers can require a certain token text/passphrase for uploads. It is up to the server how this is interpreted. It could be used as a simple password, or even a command to further instruct the server about what to do with the uploaded data. Please refer to the server's instructions about what to enter here. The token may also be left empty. | ||
100 | |||
101 | The text entered into the upload dialog's main text field is protected against accidental closing of the dialog or the application, or a crash. The previous text is restored when the dialog is reopened. The text field contents are only cleared when the submitted Titan request has been successfully completed. | ||
102 | |||
103 | ## 1.9 Split view mode (iPad only) | ||
104 | |||
105 | By default, only one tab is visible at a time in the application window. However, sometimes it is beneficial to see two pages at once. For example, many capsules have top-level menus or lists of articles, and keeping the menu/index visible on the side makes navigation less cumbersome. | ||
106 | |||
107 | Split view mode divides the UI into two equivalent parts. You can have multiple tabs in each split. Closing all tabs on one side will remove the split and return back to the normal unsplit mode. | ||
108 | |||
109 | Each split has its own sidebars, which means that in split view mode you can have a total of four sidebars open at the same time. | ||
110 | |||
111 | ### 1.9.1 Switching focus | ||
112 | |||
113 | At any given time, one of the splits has input focus. This is indicated by a colored line at the top of the section, and some UI elements will be dimmed out on the unfocused side. | ||
114 | |||
115 | If a keyboard is connected, you can use the Next/Previous Tab keybindings or Ctrl+Tab to switch keyboard focus between the sections. Next/Previous Tab is particularly convenient as it cycles through all open tabs, jumping to the other side of the split when appropriate. You may also press Tab to cycle input focus between all the URL input fields. | ||
116 | |||
117 | ### 1.9.2 Pinning | ||
118 | |||
119 | While it is sometimes useful to simply have two independent browsers open side by side, by default view splitting is meant to assist in navigating hierarchies and lists. In the typical use case, you'll have a menu or an index page on the left, and a content page open on the right. Links clicked on the left will automatically open on the right. | ||
120 | |||
121 | This is called "pinning" and the behavior can be configured in Settings. The "Split view pinning" setting on the "General" page of Settings controls where links get opened in a split view. There are three modes available: | ||
122 | |||
123 | * "None" causes links to open in the tab where the link is clicked. In this mode, both sides of the split can be navigated independently. | ||
124 | * "Left Tab" causes links clicked on the left tab to open on the right side. The page open in the left tab is therefore "pinned" and does not change unless you enter a new URL or navigate to the parent or root. | ||
125 | * "Right Tab" is the same but works the other way around. The page open in the right tab is pinned and clicked links open on the left. | ||
126 | |||
127 | The default pinning mode is "Left Tab". | ||
128 | |||
129 | The β§ indicator is shown in the URL input field when the current tab is pinned. | ||
130 | |||
131 | # 2 Customization | ||
132 | |||
133 | ## 2.1 Browsing behavior | ||
134 | |||
135 | The "Open archive indices" option controls whether index.gmi pages are automatically opened while browsing the contents of a ZIP archive. The purpose is to simulate the behavior of a Gemini server where opening a directory will by default show its index page. Enabling this option makes navigating an archived copy of a capsule a more streamlined experience. | ||
136 | |||
137 | "Split view pinning" controls which tab links will be opened on when browsing in split view mode. The default mode is "Left Tab", which means that the page in the left tab is pinned (remains unchanged) when clicking on a link. For more information, see section 1.9. | ||
138 | |||
139 | ## 2.4 Fonts | ||
140 | |||
141 | This version of Lagrange supports TrueType fonts. To use a new font, simply view a .ttf (or .fontpack) file in the app and a page footer action is available for performing the installation. | ||
142 | |||
143 | The "Fonts" page of Settings contains options that affect the appearance of text in page content, the user interface, and text rendering in general. | ||
144 | |||
145 | To be precise, on this tab you can select which _typefaces_ to use for certain elements of the page and the UI; picking a particular font (including its size, weight, style, etc.) for specific elements is not possible. Lagrange controls the size and styling of text by choosing fonts according to your theme and typeface preferences. The term "font" is often used to mean "typeface" in this document and in the app UI. | ||
146 | |||
147 | The fonts for document headings, body text, preformatted blocks, and the user interface can be chosen separately. There is also a separate font for monospaced body text, used when the protocol-specific "Monospace body" option is enabled. | ||
148 | |||
149 | There are two built-in fonts available: | ||
150 | |||
151 | * "Source Sans" is the default UI font that is also used for page content. | ||
152 | * "Iosevka" is the monospaced font. | ||
153 | |||
154 | There is also an "Iosevka (compact)" variant that actually uses the font's original line spacing. It is the default for preformatted blocks to avoid gaps between lines of ASCII art, but not for body text for better legibility. | ||
155 | |||
156 | See sections 2.4.4 and 5 for more details about font management, compatibility, and configuration. | ||
157 | |||
158 | ### 2.4.1 Monospace body | ||
159 | |||
160 | The "Monospace body" option causes all pages to be displayed in a monospace font. For example, most Gopher content has been written with the assumption of a monospace font, so it may provide a better reading experience to enable this for Gopher pages. The selected "Monospace font" is applied to the entire document. | ||
161 | |||
162 | Handling of whitespace in page content also changes when this option is enabled: spaces are no longer normalized so if the source uses multiple spaces somewhere, those are shown as-is. | ||
163 | |||
164 | ### 2.4.2 ANSI escapes | ||
165 | |||
166 | => https://en.wikipedia.org/wiki/ANSI_escape_code ANSI escape code (Wikipedia): | ||
167 | > ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video text terminals and terminal emulators. | ||
168 | |||
169 | Sometimes these codes are used for things like colored ASCII art. However, Lagrange is not a terminal emulator so only a very minimal set of codes have any effect; the rest are ignored. | ||
170 | |||
171 | The "ANSI escapes" setting controls which ANSI escape codes are enabled: | ||
172 | |||
173 | * "FG Color" enables changes to text foreground color. | ||
174 | * "BG Color" enables changes to text background color. | ||
175 | * "Font Style" enables changing the font style: bold, italic, or monospace. (These correspond to codes 1, 3, and 11.) | ||
176 | |||
177 | A warning banner is displayed if any codes are detected on a page. This helps you be aware of potential visual artifacts, like text color that is being forced to black regardless of the page background color. Click on the warning to dismiss it on a per-site basis. | ||
178 | |||
179 | If you serve content via Gemini, please be aware that ANSI escapes may not be supported by clients, and may in fact disrupt the behavior of a client in unexpected ways. For instance, consider a screen reader or a web proxy that doesn't filter out the codes. Only employ ANSI escapes when the user has somehow indicated that is their preference. | ||
180 | |||
181 | ### 2.4.3 Other font options | ||
182 | |||
183 | The "Glyph warnings" option controls whether a warning will be shown when a page is missing one or more characters. This is typically due to the page being in a language that is not covered by any of the installed fonts. Clicking on the glyph warning banner opens the font management page. | ||
184 | |||
185 | "Smoothing" enables or disables glyph antialiasing. In this version, it is recommended that smoothing is always enabled. This is because the text renderer does not support hinting of any kind, which means that without smoothing, glyph shapes will be severely distorted. You may still want to try disabling this option if antialiasing causes eye strain for you. | ||
186 | |||
187 | ### 2.4.4 Managing fonts | ||
188 | |||
189 | Open "about:fonts" to see all the installed fonts, and enable, disable or uninstall individual fontpacks. At the top of the page, there is a link to the skyjake.fi Font Library: a curated collection of fontpacks that can be freely distributed. From there you can conveniently install more fonts specifically tuned for Lagrange. | ||
190 | |||
191 | The rest of the page is divided to two sections: enabled and disabled fontpacks. Individual packs can be disabled, so they remain installed but not in use. (Tip: Use the Outline sidebar to see a list of all packs, if there are many.) | ||
192 | |||
193 | Click on the "View file" links to see what each fontpack contains. The fontpack format is described in section 5: it is simply a ZIP archive with some metadata and a bunch of font files. When you install a TrueType font (i.e., copy it to the user's fonts directory), it is treated as a fontpack containing a single file, although no ZIP archive is created for it. Use the "View fontpack.ini template" link to see the generated metadata that can be used as a basis for creating an actual fontpack. | ||
194 | |||
195 | About compatibility: fonts are complex, and while the TrueType format is not the most advanced one, it still has features that are not supported in Lagrange. The technical reason is that glyphs are rasterized using stb_truetype, a rather simple TrueType font library. (It's nice and small, though.) You may find that some fonts simply fail to load correctly, or look wrong in the app. | ||
196 | |||
197 | * Hinting is not supported. | ||
198 | * Bitmap glyphs are not supported. | ||
199 | * Multi-color glyphs are not supported. | ||
200 | |||
201 | TrueType Collections (.ttc) can be used, with the restriction that each declared font uses a single index from the collection. The index must be appended to the file name: | ||
202 | ```.ttc example | ||
203 | regular = "NotoSansCJK-Regular.ttc:2" | ||
204 | ``` | ||