Notes.app - Strange font sizes

Notes is a cool app but I’m confused how font sizes are handled. If I add 20px I get 13,3px…
In addition, the title keeps its original size of 8px.

set theBody to "<div><font face=\"Helvetica\"><span style=\"font-size: 20px\"><br></span></font></div>\n<div><b><font color=\"#FE2400\"><span style=\"font-size: 20px\">A</span></font></b><span style=\"font-size: 20px\"><br></span></div>\n<div><span style=\"font-size: 20px\"><br></span></div>\n<div><span style=\"font-size: 20px\"><br></span></div>\n<div><b><font color=\"#FE2400\"><span style=\"font-size: 20px\">B</span></font></b><span style=\"font-size: 20px\"><br></span></div>\n<div><b><font color=\"#FE2400\"><span style=\"font-size: 20px\"><br></span></font></b></div>\n<div><b><font color=\"#FE2400\"><span style=\"font-size: 20px\"><br></span></font></b></div>\n<div><b><font color=\"#FE2400\"><span style=\"font-size: 20px\">C</span></font></b><span style=\"font-size: 20px\"><br></span></div>\n<div><b><span style=\"font-size: 20px\"><br></span></b></div>"

tell application "Notes"
	tell default account
		set JournalF to "Projekte"
		set res to make new note at beginning of folder JournalF with properties {body:theBody}
	end tell
end tell

As far as I know, there is no direct link between the body and the title of the created note.
The title/name is defined by an internally localized string.
Here, with your script I get “Nouvelle note”.
The body of this note contain
the “invented” title/name in Helvetica 12 points
an empty line in HelveticaNeue 20 points
a red letter A in HelveticaNeue 20 points
two empty lines in HelveticaNeue 20 points
a red letter B in HelveticaNeue 20 points
two empty lines in HelveticaNeue 20 points
a red letter C in HelveticaNeue 20 points
an empty line in HelveticaNeue 20 points

Its seems that it’s quite what is described by your own specs.
I’m only surprised to get Helvetica Neue when your code ask for Helvetica.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 17 mars 2020 19:22:58

To create this note:

you can do this:


set theBody to "<html><head></head><body style=\"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"center\" role=\"presentation\" style=\"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; background-color: rgb(242, 242, 242);\"><tbody><tr><td align=\"center\" valign=\"middle\" bgcolor=\"#f2f2f2\" style=\"border-bottom-style: none;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"640\" align=\"center\" class=\"table-full\" role=\"presentation\" style=\"min-width: 320px; max-width: 640px;\"><tbody id=\"base\"><tr data-component=\"preheaders\" data-name=\"pre1.js\" data-base=\"LR\"><td align=\"center\" valign=\"middle\" style=\"border-bottom-style: none;\"><table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" class=\"table\" role=\"presentation\" style=\"max-width: 640px;\"><tbody><tr><th align=\"center\" valign=\"top\" class=\"coldrop\" width=\"500\" style=\"font-weight: normal;\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td valign=\"top\" align=\"left\" style=\"border-bottom-style: none; font-family: pp-sans-small-regular, Tahoma, Arial, sans-serif; font-size: 12px; color: rgb(102, 102, 102); padding: 10px;\"><span data-type=\"plaintext\" data-name=\"description\" data-block=\"editable\">Μπορείτε να δείτε τις αλλαγές στον ιστότοπό μας.</span></td></tr></tbody></table></th><th align=\"center\" valign=\"top\" class=\"coldrop\" width=\"75\" style=\"font-weight: normal;\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td valign=\"top\" align=\"right\" class=\"view-online_ltr\" style=\"border-bottom-style: none; font-family: pp-sans-small-regular, Tahoma, Arial, sans-serif; font-size: 12px; color: rgb(102, 102, 102); white-space: nowrap; padding: 10px 10px 10px 0px;\"><a data-type=\"plaintext\" data-name=\"View online text\" data-block=\"editable\" href=\"https://epl.paypal-communication.com/H/2/v400000170fc5f51a89d87e96e96c569c8/92c0975b-12bb-462c-8ea0-b3aa743ff024/HTML\" target=\"_blank\" style=\"color: rgb(102, 102, 102); font-size: inherit; line-height: inherit;\">Προβολή στο Internet</a></td></tr></tbody></table></th></tr></tbody></table></td></tr><tr data-component=\"headers\" data-name=\"h1.1.js\" data-base=\"LR\"><td align=\"center\" valign=\"middle\" bgcolor=\"#ffffff\" style=\"border-bottom-style: none; background-color: rgb(255, 255, 255);\"></td></tr><tr data-component=\"blocks\" data-name=\"b5.1.js\" data-base=\"LR\"><td align=\"center\" valign=\"middle\" bgcolor=\"#ffffff\" style=\"border-bottom-style: none; padding: 0px; background-color: rgb(255, 255, 255);\"><table width=\"560\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" class=\"table\" role=\"presentation\" style=\"max-width: 560px;\"><tbody><tr><td align=\"center\" valign=\"middle\" class=\"pad2035nobot\" style=\"border-bottom-style: none; padding: 20px 20px 0px;\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align=\"left\" role=\"presentation\"><tbody><tr><td align=\"left\" valign=\"middle\" style=\"border-bottom-style: none; padding: 0px;\"><p data-max=\"216\" data-type=\"richtext\" data-name=\"Body copy\" data-block=\"editable\" style=\"margin: 0px; font-family: pp-sans-small-regular, Tahoma, Arial, sans-serif; font-size: 16px; line-height: 24px;\"><font color=\"#ff1300\">Αυτή τη στιγμή,</font><font color=\"#6c7378\"> δεν χρειάζεται να κάνετε κάτι. Ωστόσο, αν θέλετε να μάθετε περισσότερα, μπορείτε να βρείτε πληροφορίες σχετικά με αυτές τις αλλαγές, πότε ισχύουν και τι μπορείτε να κάνετε αν θέλετε να τις απορρίψετε στη σελίδα&nbsp;</font><a target=\"_blank\" href=\"https://epl.paypal-communication.com/T/v400000170fc5f51a89d87e96e96c569c8/92c0975b12bb462c0000021ef3a0bcc4/92c0975b-12bb-462c-8ea0-b3aa743ff024?__dU__=v0G4RBKTXg2GtDSXU69hUjn5RqR7EEyYkx\" data-linkname=\"Ενημερώσεων πολιτικής\" data-tag=\"GEN\" title=\"Ενημερώσεων πολιτικής\" style=\"color: rgb(108, 115, 120); font-size: inherit; font-family: inherit; line-height: inherit;\">Ενημερώσεις πολιτικής</a><font color=\"#6c7378\">.</font><br><font color=\"#6c7378\">Μπορείτε επίσης να δείτε αυτές τις αλλαγές στον ιστότοπο&nbsp;</font><a href=\"http://paypal.com/gr\" style=\"color: inherit; text-decoration: none; font-size: inherit; font-family: inherit; line-height: inherit;\">paypal.com/gr</a><font color=\"#6c7378\">, πατώντας την επιλογή «Νομικό περιεχόμενο» στο κάτω μέρος της σελίδας και στη συνέχεια επιλέγοντας «Ενημερώσεις πολιτικής».</font><br><br><font color=\"#6c7378\">Αν έχετε </font><font color=\"#00ff00\">απορίες</font><font color=\"#6c7378\"> σχετικά με οποιαδήποτε από τις αλλαγές ή γενικότερα για τον λογαριασμό σας, μην διστάσετε να&nbsp;</font><font color=\"#f1dc00\"><a target=\"_blank\" href=\"https://epl.paypal-communication.com/T/v400000170fc5f51a89d87e96e96c569c8/92c0975b12bb462c0000021ef3a0bcc5/92c0975b-12bb-462c-8ea0-b3aa743ff024?__dU__=v0G4RBKTXg2GtDSXU69hUjn5RqR7EEyYkx\" data-linkname=\"Επικοινωνία\" data-tag=\"GEN\" title=\"Επικοινωνία\" style=\"font-size: inherit; font-family: inherit; line-height: inherit;\">επικοινωνήσετε</a>&nbsp;</font><span style=\"color: rgb(108, 115, 120);\">μαζί μας.<br></span></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></body></html>"

tell application "Notes" to tell default account
	set JournalF to "Projekte"
	set res to make new note at beginning of folder JournalF with properties {body:theBody}
end tell

@KniazidisR

What is puzzling is the fact that with its code, Joy get 13.3 pixels size when it give the asked 20 pixels size on my machine.

All of us, we get logically the title using 8 pixels size.

I wonder if the described oddity continue to strike on Joy’s machine or if it disappeared after a reboot.

I received several reports of this kind of problem, mostly with Mojave and Catalina, but High Sierra is not free of them.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 21 mars 2020 17:35:40

As you can see from my HTML example, the size of the displayed font 20px can be reduced if the cell of the table (into which the letter is squeezed) is <20 px. As I see from the OP’s example, it does not adjust any parameters of either the tables or their cells. Therefore, Notes most likely takes some default values at the current moment. That is, I want to say that a number of important instructions are missing in OP’s HTML.

What is puzzling is that, when I run the OP’s script on my machine, the text supposed to be 20 points heigh really appear with this setting.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 22 mars 2020 16:59:15