Font Saga Continues (#1338)

Nuke comic, just use monospace..... make life easy
This commit is contained in:
Charles 2025-05-04 17:03:45 -04:00 committed by GitHub
parent e1eaf805ea
commit f2f1026a97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 24 deletions

View File

@ -378,7 +378,7 @@ class EditProfile extends BaseEditProfile
->label(trans('profile.font'))
->options(function () {
$fonts = [
'ComicMono' => 'ComicMono ( Default )', //default
'monospace' => 'monospace', //default
];
if (!File::exists(public_path('storage/fonts'))) {
@ -396,30 +396,15 @@ class EditProfile extends BaseEditProfile
return $fonts;
})
->reactive()
->default('ComicMono')
->default('monospace')
->afterStateUpdated(fn ($state, callable $set) => $set('font_preview', $state)),
Placeholder::make('font_preview')
->label('Preview')
->content(function (Get $get) {
$fontName = $get('console_font') ?? 'No font selected.';
$fontName = $get('console_font') ?? 'monospace';
$fontSize = $get('console_font_size') . 'px';
$fontUrl = asset("storage/fonts/{$fontName}.ttf");
if ($fontName === 'ComicMono') {
return new HtmlString(<<<HTML
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/comic-mono@0.0.1/index.css">
<style>
.preview-text {
font-family: Comic Mono;
font-size: $fontSize;
margin-top: 10px;
display: block;
}
</style>
<span class="preview-text">The quick blue pelican jumps over the lazy pterodactyl. :)</span>
HTML);
}
return new HtmlString(<<<HTML
<style>
@font-face {

View File

@ -1,14 +1,11 @@
<x-filament::widget>
@assets
@php
$userFont = auth()->user()->getCustomization()['console_font'] ?? 'ComicMono';
$userFont = auth()->user()->getCustomization()['console_font'];
$userFontSize = auth()->user()->getCustomization()['console_font_size'] ?? 14;
$userRows = auth()->user()->getCustomization()['console_rows'] ?? 30;
@endphp
@if ($userFont === 'ComicMono')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/comic-mono@0.0.1/index.css">
@else
@if($userFont)
<link rel="preload" href="{{ asset("storage/fonts/{$userFont}.ttf") }}" as="font" crossorigin>
<style>
@font-face {
@ -75,7 +72,7 @@
let options = {
fontSize: {{ $userFontSize }},
fontFamily: '{{ $userFont }}',
fontFamily: '{{ $userFont }}, monospace',
lineHeight: 1.2,
disableStdin: true,
cursorStyle: 'underline',