Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: load font error -  (Read 1549 times)

0 Members and 1 Guest are viewing this topic.

Kehrbert

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
load font error -
« on: February 03, 2024, 06:19:54 pm »
Hello,

I am having troubles loading a font to display text in SFML.
I tried to load the fonts from my System/Library/ folder of my mac m1 as well as fonts that have been copied into the workspace folder. Including the fonts seems to work in both cases but when i hit the build button i get loads of error messages telling me:

warning: null character ignored [-Wnull-character]
error: source file is not valid UTF-8

I am working with visual studio code. My project is based on the FSML Cmake example project. 

I guess this muss be some stupid beginner mistake but i just cant find a solution.
Can anybody please point me in the right direction?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: load font error -
« Reply #1 on: February 05, 2024, 09:38:23 am »
Sounds more like you have some non-valid UTF-8 characters in your source code files.

Do you use any special characters? What encoding did you use on the source files?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: load font error -
« Reply #2 on: February 05, 2024, 10:19:28 am »
Including the fonts seems to work in both cases but when i hit the build button i get loads of error messages
When you say "including the fonts" you don't mean #include do you? Because that would definitely cause compile errors.