Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 06-06-2015, 01:12 PM   #1
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default Font size in scripts issue in different platforms Win vs Mac

It seems that this results in different font sizes in pixels between Windows and Mac. Mac being a bit bigger than Windows.
Code:
gfx.setfont(1,"Arial", 14)
gfx.drawstr("This is Arial font size 14")
Is Arial the same font and available in OSX as it is in Windows?
How can we make same font sizes on both platforms?
heda is offline   Reply With Quote
Old 06-06-2015, 02:08 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

There is few common font (windows linux mac), the simplest list of that came from the web and are called web-safe-font.

There must be something different about how the text is rendered....
I will prepare a/b screenshot windows mac with your region manager window (which has a lot of text).
X-Raym is offline   Reply With Quote
Old 06-06-2015, 02:15 PM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

try this too please
Code:
gfx.setfont(1,"Arial", 14)
gfx.drawstr("This is Arial font size 14")
w,h=gfx.measurestr("This is Arial font size 14")
reaper.ShowConsoleMsg("Width=" .. w)
reaper.ShowConsoleMsg("Height=" .. h)
and tell me if the numbers are different in OSX.
maybe we can find a proportion and do something like this
Code:
OS=reaper.GetOS()
if OS=="OSX32" or OS=="OSX64" then
  gfx.setfont(1,"Arial", 13.8)
else
  gfx.setfont(1,"Arial", 14)
end
edit: mmm I don't know... setting 13 or 13.9 seems to be the same font size in windows. it seems it only accepts integers.
heda is offline   Reply With Quote
Old 06-07-2015, 04:18 AM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

it shows :

Code:
Width=150.0Height=18.0
I send you other screenshots in a moment.
X-Raym is offline   Reply With Quote
Old 06-07-2015, 05:07 AM   #5
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

Quote:
Originally Posted by X-Raym View Post
it shows :

Code:
Width=150.0Height=18.0
I send you other screenshots in a moment.
in Windows 7 x64:
Width=116.0Height=14.0

so that's the problem

but I think we can't do anything
heda is offline   Reply With Quote
Old 06-07-2015, 05:51 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Can't a simple "os based coef multiplicator" do the tricks ?
If OSX then font size = font-size * 0.x ?

The minimum we can do is... bug report :P
X-Raym is offline   Reply With Quote
Old 06-07-2015, 06:03 AM   #7
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

it doesn't work for me
maybe it works in Mc? I don't think so.. I think it only accepts integers, which is really strange

Quote:
Originally Posted by heda View Post
edit: mmm I don't know... setting 13 or 13.9 seems to be the same font size in windows. it seems it only accepts integers.
heda is offline   Reply With Quote
Old 03-19-2016, 05:03 AM   #8
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

bumping this issue. Please fix

It's difficult to program for PC and MAC with different font sizes.

Specially when I don't have a Mac to test it.
Did I hear somebody wants to donate me an old unused mac for testing my scripts on Mac?
heda is offline   Reply With Quote
Old 03-19-2016, 05:06 AM   #9
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

I use OSX in VirtualBox for testing these things (depending on font, and not always has same coefficient).
mpl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.