diff options
author | alyx <alyx@aleteoryx.me> | 2024-01-12 01:28:22 -0500 |
---|---|---|
committer | alyx <alyx@aleteoryx.me> | 2024-01-12 01:28:22 -0500 |
commit | 7e4da5f0de16c35ce304620bd37b08d57ff46858 (patch) | |
tree | 849787161f7ad0d8c4ff40c5531896b93e9c8578 /TODO.md | |
parent | b53cb296fc5a0e2c77c6074e6cc5cde45a290cdd (diff) | |
download | lfm_embed-7e4da5f0de16c35ce304620bd37b08d57ff46858.tar.gz lfm_embed-7e4da5f0de16c35ce304620bd37b08d57ff46858.tar.bz2 lfm_embed-7e4da5f0de16c35ce304620bd37b08d57ff46858.zip |
Custom font support complete
Diffstat (limited to 'TODO.md')
-rw-r--r-- | TODO.md | 62 |
1 files changed, 38 insertions, 24 deletions
@@ -1,32 +1,10 @@ # Future plans for this project: -## Custom Fonts - -For ease-of-inclusion this should probably be handled by internal code, and provided as a set of properties on `lfm_embed::ctx::model::Data`. - -There are 3 main kinds of fonts we should support. -- User-hosted fonts. These would be loaded directly from a link to a TTF,WOFF2,etc font file. -- Google fonts fonts. In theory, we'd proxy these, but that's not 100% necessary. -- Named fonts. e.x. 'serif', 'sans-serif', 'monospace'. Browser will handle these. - -There is no good way to expose a typed enum with the current wizard UI, and the resulting UI from this could allow added user flexibility. - -### Query Parameters - -- `?font=foo` corresponds directly with `* { font-family: 'foo' }` in the CSS. -- `?font=foo&include-font=https://example.com/font.otf` will additionally append `@font-face { font-family: 'foo' src: url('https://example.com/font.otf') }`. -- `?include-stylesheet` allows for general stylesheet inclusion. It may be specified N times. - -### Context Members - -- `font: object` null if no font params specified. -- `font.name: string` contains `?font` -- `font.additional_css` will contain the `?include-font` css, as well as the proxied contents of `?include-stylesheet`. - - ## Move more things internal +Untouched. + Of the crates currently relied on, the following appear too feature-packed should be replaced with simpler internal code, to reduce binary size. - duration-str @@ -35,6 +13,8 @@ Of the crates currently relied on, the following appear too feature-packed shoul ## Watermarking +Untouched. + Support for a limited form of (optional) watermaking. It would be up to the themes to include it. ### Query Parameters @@ -64,12 +44,16 @@ A warning should be output on startup. ## Additional Helpers +Untouched. + - `(range Number start: Number = 0): Number` Generates values from start to the main argument, exclusive. - `(random): Number` Generates a random float. ## Additional Services to Support +Untouched. + This should be as transparent as possible to the theme and end-user. ### Services @@ -94,3 +78,33 @@ This should be as transparent as possible to the theme and end-user. - `user.service` never not null - `user.service.type` `(audioscrobbler|listenbrainz|gnukebox)` - `user.service.domain` the string for the service's domain. + + +## Error Cache + +Untouched. + +Add support to `lfm_embed::cache::AsyncCache` for caching `Err` values with a different lifetime from `Ok` values. + + +# Completed Features + + +## Custom Fonts + +Implemented! + +### Query Parameters + +Each of these are mutually exclusive, and take priority over eachother in the order listed below. +The highest one detected will be handled and others, if present, will be silently ignored. + +- `?google_font=` the name of a google font to try loading. If it exists, the `fonts.googleapis.com` stylesheet will end up in `font.css`. The font name will end up in `font.name`. +- `?include_font=` the URL to a font to include. `font.css` will be a generated `@font-family` declaration. A provided name will be in `font.name`. +- `?font=` the name of a browser-native or system font. This will only set `font.name`. + +### Context Members + +- `font: object` null if no font overrides are present. +- `font.name: string` All text elements should have their font set to this. +- `font.css` If present, it should be placed inside a `<style>` tag somewhere. For legibility of generated HTML, preferably its own tag. |