BENNY (AUTOPLAY)'s profile picture

Published by

published
updated

Category: Web, HTML, Tech

Help with custom fonts? (FIXED)


FIXED!


I have a piece of css code that contains a custom font. I am pretty sure I followed every instruction I had to a tee but my website is not displaying the font at all. Is it the file host? Something I mistyped? Someone please help me figure this one out. This is more so just basic CSS for a website rather than for Spacehey so use that information as you will.


How the text I want to be turned into the font currently looks like:

The font is not displaying at all here.

How the font is supposed to look like: the actual font

The CSS code:

@font-face {
    font-family: 'windows_command_prompt';
    src: url('https://file.garden/Zb_8ThqH9DEExFEq/windows_command_prompt.ttf') format('truetype'); /* TTF format */
}

body {
    font-family: 'windows_command_prompt', monospace; /* Use the pixel font */
    font-size: 12px; /* Adjust the font size as needed */
    margin: 0;
    padding: 6px;
    background-image: url('https://files.catbox.moe/80qmca.png');
}



5 Kudos

Comments

Displaying 1 of 1 comments ( View all | Add Comment )

BENNY (AUTOPLAY)

BENNY (AUTOPLAY)'s profile picture

Tiny Update: I see now that only the subtitle text actually has the font but for some reason the head title doesn’t have it…


Report Comment



FIXED! I literally just forgot my site-title element existed and had the old font instead of the updated on so that’s why it wasn’t showing. Easy.

by BENNY (AUTOPLAY); ; Report

UPDATE: I learned that including all file types (woff, woff2, and ttf) together will display custom fonts more broadly across browsers. so strange how only safari displayed the ttf file but not any other browser. that was fixed once i added the other two though :)

by BENNY (AUTOPLAY); ; Report

UPDATE: I said I “fixed” it but the font messed up again. I recommend using inspect element on your browser and going on the console section. It showed that there was a problem with the links. Which is strange because there was nothing wrong with the file host but I replaced the links anyways with new ones from the same host and it magically worked again. So yay!

by BENNY (AUTOPLAY); ; Report