fix: Remove unused files
This commit is contained in:
1 parent
9d65dc3184
commit
766212f119
10 files changed
+7
-201
No files matched your search
+1
-5
@@ -1,14 +1,12 @@
|
||||
import figlet from './vendor/figlet.js';
|
||||
import {fonts} from './font-catalog.js';
|
||||
import {render as renderBitmap} from './bitmap.js';
|
||||
|
||||
export const styles = [...fonts, 'compact'];
|
||||
export const styles = fonts;
|
||||
export const FONT_CACHE = `ascii-pwa-fonts-${encodeURIComponent(new URL('./', import.meta.url).href)}-figlet-1.8.2`;
|
||||
const pendingFonts = new Map();
|
||||
|
||||
// Keep existing lowercase font links working with the library's font names.
|
||||
export function resolveFont(name) {
|
||||
if (name === 'compact') return name;
|
||||
return fonts.find(font => font.toLowerCase() === String(name).toLowerCase()) || 'Standard';
|
||||
}
|
||||
|
||||
@@ -19,7 +17,6 @@ export function registerFont(name, data) {
|
||||
|
||||
export function renderLoaded(text, font = 'Standard') {
|
||||
if (text.length > 500) throw new Error('Text is too long');
|
||||
if (font === 'compact') return renderBitmap(text, font);
|
||||
if (!fonts.includes(font)) throw new Error('Unknown lettering style');
|
||||
return figlet.textSync(text, {
|
||||
font, width: 80, whitespaceBreak: true,
|
||||
@@ -28,7 +25,6 @@ export function renderLoaded(text, font = 'Standard') {
|
||||
|
||||
export async function render(text, font = 'Standard') {
|
||||
if (text.length > 500) throw new Error('Text is too long');
|
||||
if (font === 'compact') return renderBitmap(text, font);
|
||||
if (!fonts.includes(font)) throw new Error('Unknown lettering style');
|
||||
if (!figlet.figFonts[font]) {
|
||||
if (!pendingFonts.has(font)) {
|
||||
|
||||
Reference in new issue
Block a user