add: option to use inter font instead
This commit is contained in:
parent
da58323ed8
commit
407155e6c4
5 changed files with 26 additions and 5 deletions
|
@ -25,10 +25,6 @@ cd ../tetratto
|
||||||
|
|
||||||
Your first start of Tetratto might be a little slow as it's going to download all icon SVGs required for the HTML templates to render properly. These icons will be stored on disk, so there's no need to worry about this time _every_ restart.
|
Your first start of Tetratto might be a little slow as it's going to download all icon SVGs required for the HTML templates to render properly. These icons will be stored on disk, so there's no need to worry about this time _every_ restart.
|
||||||
|
|
||||||
Tetratto attempts to load `/public/fonts/lexend_variable.woff2` by defualt. This font is not included in the source by default, so you must download it yourself. Download Lexend (available from Google Fonts) as a variable font, and then create a `fonts` directory in the created `public` directory (relative to your configuration file). Place the font file (named "lexend_variable.woff2") in this fonts directory.
|
|
||||||
|
|
||||||
Please note that Google Fonts only distributes Lexend Variable as a TTF file. You can use [`woff2_convert`](https://github.com/google/woff2) to convert the TTF into a woff2 file (`woff2_convert lexend_variable.ttf`).
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
In the directory you're running Tetratto from, you should create a `tetratto.toml` file. This file follows the configuration schema defined [here](https://trisuaso.github.io/tetratto/tetratto/config/struct.Config.html)!
|
In the directory you're running Tetratto from, you should create a `tetratto.toml` file. This file follows the configuration schema defined [here](https://trisuaso.github.io/tetratto/tetratto/config/struct.Config.html)!
|
||||||
|
|
|
@ -87,7 +87,8 @@
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Lexend";
|
font-family: "Lexend";
|
||||||
src: url("/public/fonts/lexend_variable.woff2") format("woff2");
|
src: url("https://repodelivery.tetratto.com/fonts/lexend_variable.woff2")
|
||||||
|
format("woff2");
|
||||||
}
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
|
@ -106,6 +107,14 @@ body {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.use_system_font,
|
||||||
|
html:has(body.use_system_font) {
|
||||||
|
font-family:
|
||||||
|
"Inter", "Poppins", "Roboto", ui-sans-serif, system-ui, sans-serif,
|
||||||
|
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
||||||
|
"Noto Color Emoji";
|
||||||
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
width: 80ch;
|
width: 80ch;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
@ -184,6 +193,13 @@ p {
|
||||||
margin-bottom: var(--pad-4);
|
margin-bottom: var(--pad-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
span:not(nav *):not(.dropdown *):not(a *):not(button *),
|
||||||
|
input,
|
||||||
|
textarea {
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
.no_p_margin p:last-child {
|
.no_p_margin p:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1809,6 +1809,11 @@
|
||||||
\"{{ profile.settings.large_text }}\",
|
\"{{ profile.settings.large_text }}\",
|
||||||
\"checkbox\",
|
\"checkbox\",
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
[\"use_system_font\", \"Always use system font instead\"],
|
||||||
|
\"{{ profile.settings.use_system_font }}\",
|
||||||
|
\"checkbox\",
|
||||||
|
],
|
||||||
[
|
[
|
||||||
[\"paged_timelines\", \"Make timelines paged instead of infinitely scrolled\"],
|
[\"paged_timelines\", \"Make timelines paged instead of infinitely scrolled\"],
|
||||||
\"{{ profile.settings.paged_timelines }}\",
|
\"{{ profile.settings.paged_timelines }}\",
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
(text "{% block head %}{% endblock %}"))
|
(text "{% block head %}{% endblock %}"))
|
||||||
|
|
||||||
(body
|
(body
|
||||||
|
("class" "{% if user and user.settings.use_system_font -%} use_system_font {%- endif %}")
|
||||||
(div
|
(div
|
||||||
("id" "page")
|
("id" "page")
|
||||||
(text "{% if user and user.id == 0 -%}")
|
(text "{% if user and user.id == 0 -%}")
|
||||||
|
|
|
@ -372,6 +372,9 @@ pub struct UserSettings {
|
||||||
/// Hide all badges from your username (everywhere but on profile).
|
/// Hide all badges from your username (everywhere but on profile).
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub hide_username_badges: bool,
|
pub hide_username_badges: bool,
|
||||||
|
/// If the user's system font is always used over Lexend.
|
||||||
|
#[serde(default)]
|
||||||
|
pub use_system_font: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mime_avif() -> String {
|
fn mime_avif() -> String {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue