Welcome, Guest
Username: Password: Remember me
CodeTyphon Cross-Build Development, discussions and problems
  • Page:
  • 1

TOPIC:

Label, font size problems 10 years 6 months ago #5470

  • Matija
  • Matija's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hello!
I have problem with my program when I crosscompile it to Raspberry PI.
It is simple form with few labels (standard palette) on and two buttons.
procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Font.Height := 20;
  Label2.Font.Size := 20;
  Label3.Font.Color := clred;
  Label4.Font.Style := [fsbold];
  Button2.Font.Size := 15;
end; 

procedure TForm1.Button2Click(Sender: TObject);
begin
  Label1.Font.Height := 0;
  Label2.Font.Size := 0;
  Button2.Font.Size := 0;
end;

When I run this on win7 and I press Button1 I get labels modified according to code.
When I crosscompile this code on ARM (Raspberry PI), Label1 and Label2 dissapere from screen. Text in Button2 also dissapeare. Label3 become red and Label4 become bold.
When I press Button2 Label1 and Label2 are visible again in normal size. The same with button2.

The computer that I am using for programing is Win7, 32 bit PC.
Program is Typhon32IDE v4.8; FPC version 2.7.1; SVN revision: 44546
Library for crosscompile is arm-linux-pi downloades from server this week.

I susspect that it has something to do with compiling massage

Options changed, recompiling clean with -B
project1.lpr(22) Warning: "crti.o" not found, this will probably cause a linking failure
project1.lpr(22) Warning: "crtbegin.o" not found, this will probably cause a linking failure
project1.lpr(22) Warning: "crtend.o" not found, this will probably cause a linking failure
project1.lpr(22) Warning: "crtn.o" not found, this will probably cause a linking failure
Project "project1" successfully built


But surfing on the net didn't give me any good solution. Have any any idea how to solve this?

Regards, Matija

Please Log in or Create an account to join the conversation.

Last edit: by Matija.

Label, font size problems 10 years 6 months ago #5491

  • Matija
  • Matija's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hello!

I install Linux Debian on new machine and also install CodeTyphon with cross compile to ARM.
I made the same program as above and on Linux was working OK, when I cross compile to arm and run it on Raspberry PI I get the same problem.
Label1 and Label2 disappere where I press Button1 and reappere when I press Button2. Tha same with Buton2 text.

Does anybody cross compile to Raspberry PI and can manage text size on Labels or Buttons?
I will be very grateful for any pointing direction to salve my problem.

Regards,
Matija

Please Log in or Create an account to join the conversation.

Label, font size problems 10 years 6 months ago #5492

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Sir, did you try to set and font name property?
a valid font name for arm box
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Label, font size problems 10 years 6 months ago #5493

  • Matija
  • Matija's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hello Sternas
That is a good direction to look into. Thank you.

I check the font in RPI and they are different from the one on PC, so I copy one from PC to RPI into /home/pi/.fonts
I check it with
# fc-list – lists fonts
# fc-cache -fv – rebuilds cached list of fonts
and it was included. The same font I use on my program, but no success.

Then I take fonts from folder on RPI /usr/share/fonts/truetype (druid serif, druid sans,dejavu sans) and copy them to PC and use this font in program and again no success.

I try with different fonts with default size and they appere on screen, but when I increase the size they dissapere. All this fonts are seen in Lazarus on RPI.
Do you have any other idea that I can look into.

Regards, Matija

Please Log in or Create an account to join the conversation.

Label, font size problems 10 years 2 months ago #5992

  • universe
  • universe's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 122
  • Thank you received: 8
Hello,
I'm facing the same problem on the raspberry pi, despite I'm using the default font settings, all TEdit controls have a height of about 2 pixels (typing doesn't show any character inside) and TLabels are invisible, after running my program from the shell it displays a bunch of:
TheFontStock.CalcFontAdvance: Font=DejaVu Sans Mono Size=10 No Width from GetTextExtentPoint 
TheFontStock.CalcFontAdvance: Font=DejaVu Sans Mono Size=10 No Height from GetTextExtentPoint, tmHeight=1
The errors are for DejaVu Sans Mono and Courier New
I checked that the fonts are installed, and I even changed the fonts to very obvious as "Arial", and the font size to 8 and 12, but it doesn't work either.
Thanks for any hint

Please Log in or Create an account to join the conversation.

Last edit: by universe.

Label, font size problems 10 years 2 months ago #5995

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4535
  • Thank you received: 1114
Sir, My suggestion:
On Multi-OS application set "Main Form" Fonts at run-time with Code onFormShow procedure
Some fonts in unix systems are only links to other Free font files

From sample "Courier 10 pitch" in Debian is Not the same with "Courier 10 pitch" on windows
in order to use "Courier 10 pitch" as Typhon IDE fonts, we install "xfonts-scalable" debian pkg

codetyphon/ScriptsLin/systems/ln1_Install_SysLibraries_For_Debian.sh
Line 21: sudo apt-get install -y xfonts-scalable
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: universe

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

Label, font size problems 10 years 2 months ago #5998

  • universe
  • universe's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 122
  • Thank you received: 8
Hello, after starting a new project I noticed that the default font size is 0 not 10, so I have to correct I was not running the program with default font settings (I thought it should be 10 size). So I noticed that only font size 0 is working changing the font name or size on design-time or run-time didn't change it. So I just changed the font style to Bold, as I want to display big fonts. Just for info there is two font names "default" and "Default" that are not the same on the host (CT), Default is apparently 14 font size, on raspberry it didn't make a difference, the font size is always the same, I think I have to change the default font size on the raspberry pi itself as a quick solution.
Thanks for your reply.

Please Log in or Create an account to join the conversation.

Label, font size problems 9 years 11 months ago #6370

  • Thomas Haemmerle
  • Thomas Haemmerle's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi!

Any improvements or hints on this topic?
'Cause I have exactly the same problem - my test case:

put a TLabel on a new form in a new project, than crosscompile it (in my case crosscompile for linux/arm - by the way, I am using as host OS: Linux Arch 64bit; 3.17.3-1; fpc: 2.7.1; codetyphon: 5.1)

-> the crosscompiled program is working on eg. raspberry pi - arm processor
if you check the TLabels font.size it shows 0; still the label is displayed. when dynamically changing to a value other then 0 the the label disappears. (Changing Bold oder Fontname is working!?)

Strange side effect, crosscompile to linux/32 and changing the font size is working.

For the time I am trying to set up lazarus on the raspberry to compile it there. What I have read so far, it will work then - the problem has something to do with the crosscompiling and the fact, that on the arm/target system the default font size could be something diffrent from the size on the host. Never the less, I could not find any thing how to change the size on the target (arm) system.

Does anybody have am idea how to change the labels font.size?

Thanks for any hint!

BRGDS

max

Please Log in or Create an account to join the conversation.

Label, font size problems 9 years 11 months ago #6372

  • Matija
  • Matija's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hello,

from my side no improvements.
I stop looking for this problem, because I use CodeTyphooh on my Win7 where I write code and copy it (direct file copy using WinSCP) to RPI, where I use Lazarus and compiled it again.
Benefits of doing that is, that RPI check the code, which is different from Win7 (using GPIO) and you can also debug directly.

Regards,
Matija

Please Log in or Create an account to join the conversation.

Label, font size problems 9 years 11 months ago #6373

  • Thomas Haemmerle
  • Thomas Haemmerle's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi,

thanks for your answer - I think to keep it simple I will do it the same way. I have been trying around now since a day no improvement. TLabel is only useable in one size.

Thanks!

max

Please Log in or Create an account to join the conversation.

  • Page:
  • 1