Skip to content

Conversation

@JoanFo1456
Copy link
Contributor

With mristau we repaired that on browser console when loading EditProfile or server console would show that monospace.ttf doesn't exist.

When loading the page on monospace, will say that monospace.ttf is missing, this fixes it.
Copy link
Member

@rmartinoscar rmartinoscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't use gh thing cause you are not allowed to comment on lines that weren't edited in this PR

Placeholder::make('font_preview')
    ->label(trans('profile.font_preview'))
    ->columnSpan(2)
    ->content(function (Get $get) {
        $fontName = $get('console_font') ?? 'monospace';
        $fontSize = $get('console_font_size') . 'px';
        $style = <<<CSS
            .preview-text {
                font-family: $fontName;
                font-size: $fontSize;
                margin-top: 10px;
                display: block;
            }
        CSS;
        if ($fontName !== 'monospace') {
            $fontUrl = asset("storage/fonts/$fontName.ttf");
            $style = <<<CSS
                @font-face {
                    font-family: $fontName;
                    src: url("$fontUrl");
                }
                $style
            CSS;
        }

        return new HtmlString(<<<HTML
        <style>
        $style
        </style>
        <span class="preview-text">The quick blue pelican jumps over the lazy pterodactyl. :)</span>
        HTML);
    }),

@JoanFo1456
Copy link
Contributor Author

We thought of that, but was sketchy for us, that's why it is this way, but sure I'll change it.

@JoanFo1456 JoanFo1456 requested a review from rmartinoscar May 25, 2025 14:09
@JoanFo1456 JoanFo1456 requested a review from rmartinoscar May 25, 2025 17:27
@JoanFo1456
Copy link
Contributor Author

Everything seems good to be merged, so if you guys want, go ahead.

@rmartinoscar rmartinoscar merged commit af60999 into pelican-dev:main Jun 8, 2025
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2025
@JoanFo1456 JoanFo1456 deleted the FixMissingFont branch June 8, 2025 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants