Recent

Author Topic: Cocoa - How to get started with helping?  (Read 39954 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #45 on: December 29, 2017, 09:03:47 pm »

Why are there two screenshots in each .png? What am I missing?


Top window is the application in runtime, bottom window is design time.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cocoa - How to get started with helping?
« Reply #46 on: December 29, 2017, 09:04:36 pm »
TextEdit. How does it look in TextEdit?


The height some how resets in Carbon but not in Cocoa.
Looks like the fonts are OK in a TEdit under Cocoa.

By "TextEdit" he meant the app TextEdit, not the control TEdit. TextEdit will show how the fonts are supposed to look. If Carbon or Cocoa widgetsets can't reproduce that, then they're wrong.


Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cocoa - How to get started with helping?
« Reply #47 on: December 29, 2017, 09:07:36 pm »

Why are there two screenshots in each .png? What am I missing?


Top window is the application in runtime, bottom window is design time.

Got it.

Note that Mac apps never use "Arial" - that's something that Windows apps used to use. Try a common font for Mac apps like Lucida Grande.

Edit: Lucida, not Lucinda (woman's name).
« Last Edit: December 29, 2017, 09:13:28 pm by Phil »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cocoa - How to get started with helping?
« Reply #48 on: December 29, 2017, 09:11:58 pm »
Looks like the fonts are OK in a TEdit under Cocoa.

I carefully assume you didn't need Linux/Windows with this. If you do need them; let me know  :)

I would do Windows and Linux too. I believe the fonts are too small in TEdit. Compare Laz 1.8.0 Carbon with Laz 1.6.4 Carbon. I think that's a regression.

See this bug report's example app for various controls that show problems with both Cocoa and Carbon.

https://bugs.freepascal.org/view.php?id=31912

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #49 on: December 29, 2017, 09:21:53 pm »
By "TextEdit" he meant the app TextEdit, not the control TEdit. TextEdit will show how the fonts are supposed to look. If Carbon or Cocoa widgetsets can't reproduce that, then they're wrong.


I think I need more coffee haha ... thanks Phil, I totally misread that. I'll try again in TextEdit.
Anyhoo ... Cocoa runtime and design time next to TextEdit.
Looks like Carbon, Windows and Linux show the same size amongst each other and in design vs runtime.
Cocoa (the test app and TextEdit) seem to use a different size than those other 3 widgetsets.


Interesting problem. Make Cocoa match the other 3 (so cross platform compiling doesn't become a nightmare designwise) or stick with the Cocoa rules ..  :o

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cocoa - How to get started with helping?
« Reply #50 on: December 29, 2017, 09:42:40 pm »
Yes. This is exactly what I'm looking for.

Now, the question is - how do you set the label size?
Do you use HEIGHT or SIZE?  - if you're using HEIGHT, please switch to SIZE and repeat the try.

In TextEdit you always set SIZE. (but the size is measured in Points (PT) not Pixles (PX)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cocoa - How to get started with helping?
« Reply #51 on: December 29, 2017, 09:44:44 pm »
Interesting problem. Make Cocoa match the other 3 (so cross platform compiling doesn't become a nightmare designwise) or stick with the Cocoa rules ..  :o

Here's example of what I mean about the current regressions and problems in fonts with both Carbon and Cocoa widgetsets.

- Carbon, Laz 1.6.4
- Carbon, Laz SVN
- Cocoa, Laz SVN
- TextEdit

Note how Carbon fonts under previous Laz 1.6.4 matches what's in TextEdit. Carbon SVN now shows some controls small, some like 1.6.4. And Cocoa SVN shows all controls small.

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #52 on: December 29, 2017, 09:45:10 pm »
I had to redo the TLabel test for Linux - I just now noticed that Comic Sans MS and Courier New fonts did not exist on my Linux setup.
So attached; a new TLabel test for Linux and a TEdit test.
I have no easy editor like TextEdit on my Linux setup. The closest I have is LibreOffice but Writer scales the window, so that would not be a correct replication right?

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #53 on: December 29, 2017, 09:53:42 pm »
Here a screenshot, runtime, design time, and WordPad - not sure how reliable all these rich text editors are.
Wordpad does seem to do scaling as well (default set to 100% - just not sure what they mean with 100% haha).


In all examples I used Font - Size. Not height.
And I'm intentionally not using the font dialog, just manually setting Font - Name and Font - Size.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cocoa - How to get started with helping?
« Reply #54 on: December 29, 2017, 10:05:27 pm »
Looks like Carbon, Windows and Linux show the same size amongst each other and in design vs runtime.
Cocoa (the test app and TextEdit) seem to use a different size than those other 3 widgetsets.
No.
The screenshot explicitly shows the problem with Carbon font-sizing.
While Cocoa sizing is accurate and is matching to what system would produce.

There test has an issue with "Standard" font.
The default font selected for macOS is not Lucida Grande. It's something else (and it varies from macOS versions as well)

If you look carefully on the screenshot, you might notice the following differences in "standard" font for Cocoa and TextEdit
* number 2 (in 24px) has different shapes
* number 4 is also a slightly different shape
* the space between letters is different
So what you're trying to compare are two completely different fonts.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cocoa - How to get started with helping?
« Reply #55 on: December 29, 2017, 10:09:33 pm »
Note how Carbon fonts under previous Laz 1.6.4 matches what's in TextEdit. Carbon SVN now shows some controls small, some like 1.6.4. And Cocoa SVN shows all controls small.
would the following test be fine:

* create a form with only 1 standard button on it. Set Height to 32 (will be explained later).
compile for Cocoa and run.
* create a Cocoa Application project in Xcode. Add a PushButton of a Regular Size (for height 32).
Make sure that title match.

Compare the results between Cocoa app and the interface built in Xcode.

Expected results: they should match in look and feel.

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #56 on: December 29, 2017, 10:16:43 pm »
I can see your point on Carbon font sizing being an issue.
Not sure (yet) how this translates to Windows and Linux (when moving code from platform to another), but maybe that's a worry for later.


I can create a project in Lazarus and XCode if you'd like.
So the button has to have height set to 32? Or did you mean the font size of the button?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cocoa - How to get started with helping?
« Reply #57 on: December 29, 2017, 10:18:09 pm »
I can create a project in Lazarus and XCode if you'd like.
So the button has to have height set to 32? Or did you mean the font size of the button?
32 should be height of the button.

But!!! if you find the way to change font of the button in Xcode in design time, please let me know ;)

Not sure (yet) how this translates to Windows and Linux (when moving code from platform to another), but maybe that's a worry for later.
At this point, I want to make sure that a widgetset renders
Font X with Size Y (in points)
in exactly the same manner, as a system text editor with
Font X with Size Y (in points)
selected.

That is a measurement for a widgetset to render a font properly.

If we assume that Carbon-WS is correct, and Cocoa-WS should render the font in same manner, then we're actually bringing Carbon-WS bug into Cocoa-WS. And I'd like to avoid that, taking system font rendering as a standard

« Last Edit: December 29, 2017, 10:23:15 pm by skalogryz »

Hansaplast

  • Hero Member
  • *****
  • Posts: 711
  • Tweaking4All.com
    • Tweaking4All
Re: Cocoa - How to get started with helping?
« Reply #58 on: December 29, 2017, 10:28:03 pm »
Hahah, the minute you wrote your reply, I already noticed the font size problem with XCode and design time hahah.


So, the PushButton has a fixed height, and in designtime the fontsize doesn't show - as you expected.
Funny thing though ... during runtime it DOES show a different font size.


In the XCode screenshot (let me know what you'd like me to change):


On the left: runtime. On the right: design time.
Top button is a gradient button (which can be resized, and height set to 32), the button at the bottom is a Push button.
Font is in both cases set to 32.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Cocoa - How to get started with helping?
« Reply #59 on: December 29, 2017, 10:32:53 pm »
There's no need to change font size to 32.

We're trying to compare 32 height button between LCL and Xcode, with default Font settings.

 

TinyPortal © 2005-2018