mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(settings): rebuild reader fonts on the shared font ledger
Reader › Fonts now uses the Server Fonts ledger, family sheet and upload tray for a reader's own fonts, and lists the server's fonts with a show/hide switch and a preview sheet. The shared pieces move to features/settings/fonts and the ledger columns narrow to give the specimen room. Server: additive GET /fonts/usage and PATCH /fonts/families, upload error codes, and a 409 instead of a 500 when a reader uploads a second file for the same face.
This commit is contained in:
@@ -92,12 +92,30 @@ export interface ServerFontUsageResponse {
|
||||
families: ServerFontFamilyUsage[];
|
||||
}
|
||||
|
||||
/**
|
||||
* How the current reader uses one custom font, keyed by the CSS family name their saved settings
|
||||
* store. Covers their own fonts and the server's, since both are offered in the same picker.
|
||||
*/
|
||||
export interface FontFamilyUseCount {
|
||||
cssFamily: string;
|
||||
/** This reader's books set to the family. */
|
||||
books: number;
|
||||
/** The family is this reader's default eBook font. */
|
||||
isDefault: boolean;
|
||||
}
|
||||
|
||||
export interface UserFontUsageResponse {
|
||||
fonts: FontFamilyUseCount[];
|
||||
}
|
||||
|
||||
/** Renames every file of a family together, so a failure cannot leave the family split in two. */
|
||||
export interface RenameServerFontFamilyRequest {
|
||||
export interface RenameFontFamilyRequest {
|
||||
familyName: string;
|
||||
newFamilyName: string;
|
||||
}
|
||||
|
||||
export type RenameServerFontFamilyRequest = RenameFontFamilyRequest;
|
||||
|
||||
export const FONT_FORMATS: readonly FontFormat[] = ["ttf", "otf", "woff", "woff2"];
|
||||
|
||||
export const FONT_FORMAT_EXTENSIONS: Record<FontFormat, string> = {
|
||||
|
||||
Reference in New Issue
Block a user