From a5ffff8c8c9bda3f3a765a07c6a1f6bb067fc341 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 3 May 2025 08:21:02 -0400 Subject: [PATCH] Add Comic Mono to the list (#1330) * Add Comic Mono to list and make default * Update preview * Create folder if missing. * match composer lock from pr --- app/Filament/Pages/Auth/EditProfile.php | 29 ++++++++++++++++++++++--- composer.lock | 4 ---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/Filament/Pages/Auth/EditProfile.php b/app/Filament/Pages/Auth/EditProfile.php index 66db49a08..332d03ffc 100644 --- a/app/Filament/Pages/Auth/EditProfile.php +++ b/app/Filament/Pages/Auth/EditProfile.php @@ -377,7 +377,15 @@ class EditProfile extends BaseEditProfile Select::make('console_font') ->label(trans('profile.font')) ->options(function () { - $fonts = []; + $fonts = [ + 'ComicMono' => 'ComicMono ( Default )', //default + ]; + + if (!File::exists(public_path('storage/fonts'))) { + File::makeDirectory(public_path('storage/fonts')); + $this->fillForm(); + } + foreach (File::allFiles(public_path('storage/fonts')) as $file) { if ($file->getExtension() === 'ttf') { $name = pathinfo($file->getFilename(), PATHINFO_FILENAME); @@ -388,14 +396,29 @@ class EditProfile extends BaseEditProfile return $fonts; }) ->reactive() + ->default('ComicMono') ->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.'; - - $fontUrl = asset("storage/fonts/{$fontName}.ttf"); $fontSize = $get('console_font_size') . 'px'; + $fontUrl = asset("storage/fonts/{$fontName}.ttf"); + + if ($fontName === 'ComicMono') { + return new HtmlString(<< + + The quick blue pelican jumps over the lazy pterodactyl. :) + HTML); + } return new HtmlString(<< diff --git a/composer.lock b/composer.lock index c66a27179..97febd42d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], -<<<<<<< HEAD "content-hash": "27da5be2bf613398e6fa75cdf8131bf7", -======= - "content-hash": "5c5a89d4207dd9efb7a8c3a410aa838c", ->>>>>>> main "packages": [ { "name": "abdelhamiderrahmouni/filament-monaco-editor",