How does my computer know to which character a char corresponds?

72 views Asked by At

Does my OS load a font file which maps the UTF-8 codes to characters(the way to render it ) when I start up my computer?

Since there are a lot of different fonts, the font files will consume a lot of memory?

Or the font files are stored in hard-disk and are only loaded in to the memory when needed?

Just a question that comes into my mind.

1

There are 1 answers

6
JShell On BEST ANSWER

What you're asking about is called encoding. The encoding is completely seperate from a font. The header of a file tells the OS (or reading program) which encoding the file uses(ex. ASCII or UTF-8). This encoding is how the computer knows what sequence of bits map to what characters.

Font files determine how the text looks. Time New Roman, Arial are examples of fonts. These fonts are stored on the hard-disk and are very small, almost irrelevant on any modern machine.

Does this help?

Edit: The wikipedia page may be more clear...