neurolabusc / OpenGLCoreTutorials

Cross-platform (Linux, Mac and Windows) OpenGL projects using Core specification
BSD 2-Clause "Simplified" License
19 stars 1 forks source link

mtext #3

Open PeterOnDrums opened 3 months ago

PeterOnDrums commented 3 months ago

[mtext.lpi] compiles under Windows, but shows no text. Are You able to look into this ?

neurolabusc commented 3 months ago

I am unable to resolve this problem, as the project shows text correctly for me. I am using Windows 11 Pro version 23H2 on a laptop with Intel integrated graphics. Unless I can replicate the problem, it is hard to fix. I made a clean install using the latest stable version of Lazarus and directly cloning this repository.

mtext

neurolabusc commented 3 months ago

I have also published the compiled Windows executable as mtext_windowsX86_64.zip with the latest release. I can download this compiled executable and see text on my computer.

PeterOnDrums commented 3 months ago

Hello Chris, I opened Your Executable on my computer, and it doesn't show any text. So this can't be a source code issue .. and also not a Laz 32-bit / 64-bit issue. PROBABLY A "HARDWARE PROBLEM" ? I use a GEEKOM Mini-PC with - Intel(R) Celeron(R) N5105 @ 2.00GHz 2.00 GHz - Intel(R) UHD Graphics Thanks, Peter.

I am unable to resolve this problem, as the project shows text correctly for me. I am using Windows 11 Pro version 23H2 on a laptop with Intel integrated graphics. Unless I can replicate the problem, it is hard to fix. I made a clean install using the latest stable version of Lazarus and directly cloning this repository.

I have also published the compiled Windows executable as mtext_windowsX86_64.zip with the latest release. I can download this compiled executable and see text on my computer.

Message ID:

PeterOnDrums commented 3 months ago

When I comment out this line of code in procedure TGLText.TextOut():

//if metrics.M[asci].xadv = 0 then continue; //not in dataset .. I get this:

Am 07-Jun-2024 20:29:10 +0200 schrieb @.***:

I have also published the compiled Windows executable as mtext_windowsX86_64.zip with the latest release. I can download this compiled executable and see text on my computer.

-- Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID:

neurolabusc commented 3 months ago

@PeterOnDrums Am I correct that you are in a country that uses the comma as a decimal separator (1,23) instead of a full stop (1.23)? If so, why don't you download the latest commit and see if it resolves your issue.

PeterOnDrums commented 3 months ago

Ah .. yes, I'm from Germany, Europe. We do have the comma as decimal separator :-) I'll give it a try - thanks !

Am 07-Jun-2024 21:40:13 +0200 schrieb @.***:

@PeterOnDrums Am I correct that you are in a country that uses the comma as a decimal separator (1,23) instead of a full stop (1.23)? If so, why don't you download the latest commit and see if it resolves your issue.

-- Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID:

PeterOnDrums commented 3 months ago

@neurolabusc Thanks !

I can confirm that it works now, here on Windows 11, compiled als Win32 EXE !

Screenshot (993)

PeterOnDrums commented 3 months ago

To keep the size of text under MS WINDOWS while using scaling (High DPI) in the project settings I wrote this additional function:

procedure TGLText.TextOutHighDPI(x,y,scale: single; PixelsPerInch: integer; s: string); overload; //for Windows High DPI begin TextOut( x * PixelsPerInch / 96, y * PixelsPerInch / 96, scale * PixelsPerInch / 96, 0, s); end;

for unit glmtext.pas

The caller has to set the function parameter PixelsPerInch to Screen.PixelsPerInch (from TScreen)

neurolabusc commented 3 months ago

@PeterOnDrums The latest commit should automatically scale font size when the application loads.