Open MrDadosz opened 8 months ago
The problem is you create it in different resource. The solution is create in that resource which uses it like this:
dxCreateFont(":resource/font.ttf")
It is not. I had problems with my minimap's resource so I made main resource.Previously, the problem also occurred even after setting the timer to 2500 milliseconds and using a font from the same resource. Now it uses less PC resources because I had multiple fonts created in multiple resources with same parameters. It works like 95% right, but there's 5% when it's rendering random characters. Random character like"B" sometimes could be "æ" and it will always be "æ" and only reconnect will help. Looks like sometimes it's using wrong characters, like you added +X offset to ASCII table.
I think it's a problem with the font itself. I've never had this problem with random characters over the years, and I've used many different fonts.
I'm using Roboto font and tried some others and I still have issues.
The exact same things happens to me with OpenSans font family downloaded from google
Any ideas? That's happens a lot of time, not depending on VRAM usage, fonts are okay.
Please attach a test resource along with the specific font
There are problems with almost every font from this resource. I tried to load fonts with a timer, but it's not helping. I thought it would help when I create main resource for fonts but there's the same problem. In the past, almost every resource had .ttf inside, from +100 fonts to 30 fonts. Problem exists for more than 6 months.
local nametagFont = "default-bold"
addEventHandler("onClientResourceStart", resourceRoot, function()
setTimer(function()
nametagFont = exports["dadosz-fonts"]:loadDXFont("roboto", 10)
end, 10000, 1)
end)
Sometimes it shows fonts, and sometimes it shows random characters from that font. I'm using roboto in most resources.
Happened for me after a resource restart, then I was unable to delete the font file from the client cache, because "the file is open in System" and even needed to manually delete from the server/.../resource-cache/http-client-files/ directory because the server flooded with HTTP mismatch error
Describe the bug
dxDrawText using custom font created by dxCreateFont shows randomly wrong characters. Every script that I have is encoded in UTF-8. VRAM/RAM usage isn't limited. dxCreateFont returns font element, but it's looking like random characters without any reason. There is no problem with GUI fonts, only DX fonts. I tried different fonts but every font sometimes shows like example below. I even added timers and creation on event onClientResourceStart:
My main resource dadosz-fonts (resources don't destroy fonts):
Memory statistics (dxGetStatus):
RAM used by gta_sa.exe: 1630 MB
Sometimes they look like this: https://i.imgur.com/ngJNlA8.png how they should look: https://i.imgur.com/LCzOkoF.png
Steps to reproduce
Version
Client: Multi Theft Auto v1.6-release-22388
Additional context
No response
Relevant log output
No response
Security Policy