Petite Capitals script

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Petite Capitals script

Post by Leon Gauthier »

I am working with the Petite Capitals Private Use script and the thorn (Þ), the capital letter eng (Ŋ) and the capital ligature OE (Œ) were not being scaled down as they should be. I reasoned that since they were not being composed, they should be moved from the second <GlyphInsertCharacters> group and placed into the first. That corrected the problem.

However, I cannot seem to find a way to position the accents, other than the dotbelowcomb, the commaaccent and the commaaboveright, properly with respect to the base glyphs. It seems that there must be a way to do this that I am missing here. Perhaps some tweaking of the CompositeData.xml would be the place to do it but, I am loath to touch that file.
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Petite Capitals script

Post by Bhikkhu Pesala »

Don't be loath to edit the CompositeData.xml file if you need to. That's why there is an option to "Copy Data Files to User Data Folder" in Tools, Options, Advanced.

The original file is saved in Program Files when FontCreator is installed:

<!-- Updated 27th April 2017 for FontCreator 11.0 -->

You can always delete your copied version if you broke something, and copy the original again. If you copied it once before, it won't be overwritten on using "Copy Data Files." So, check the date of the copy in \AppData\Roaming\FontCreator\Composites. There is a newer version in the Tutorial thread that fixes a few bugs.

If there is a bug in the Petite Capitals script, edit it to move the insert Thorn character (58254) before the scaling operation. Here, the Capital Letter Eng and OE are being scaled correctly so I suspect that you may have an older version of the transform script. The CompositeData script does not do any scaling; it simply composes the PUA Small Capital or Petite Capital glyphs using the basic Latin glyphs. You can verify this by using Complete Composites on the Petite Capital glyphs after running the transform script.

The Petite Capitals Script.
  1. Inserts characters mapped to the PUA
  2. Completes Composites
  3. Decomposes (makes simple)
  4. Scales them down
  5. Makes them bolder
  6. Moves them back up to the baseline to compensate for vertical bolding
  7. Set the left side-bearing point to zero.
As the latter part of the script says:
The rest of this script then adds composites of these new glyphs to create a wide range of accented small capitals and ligatures like AE. You will need to align the accents horizontally and edit some glyphs.
For the best results with Petite Capitals, you may need smaller accents than those used for the Latin-1 Supplement or Latin Extended character sets. Insert a set of low profile accents first, before running the Petite Capitals script, and edit the low profile accent glyphs to position them vertically to suit lowercase. They will then be correctly positioned vertically for Petite Capitals.

Petite Capitals are scaled to be approximately 65% the size of basic latin glyphs after bolding. The aim is to align with the x-height, which will, of course, vary from font to font, so the scale factor will probably need some adjustment.

The accents are aligned by CompositeData.xml, but may need some manual adjustment. Acute and grave accents should be offset from centre alignment.

Code: Select all

<Composite><!-- Small capital a grave -->
<GlyphMapping>58224</GlyphMapping> ; Petite or Small Capital A grave 
	<Member id="1">
	<GlyphMapping>58097</GlyphMapping> ; Petite or Small Capital A
		<UseMetrics>TRUE</UseMetrics>
	</Member>
	<Member id="2">
	<GlyphMapping>57365</GlyphMapping> ; lowprofilegraveaccent
		<GlyphMapping>96</GlyphMapping> ; grave (fallback glyph in absence of above)
		<Pos>Auto</Pos>
	</Member>
	</Composite>
Petite Capital A grave.png
Petite Capital A grave.png (25.92 KiB) Viewed 9357 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

Thanks for the coaching, Bhikkhu. I basically understand how the Petite Capitals in PUA script functions so I thought that I would write a script to create the low profile diacritics, as you suggested, in the PUA as well. Actually, I discovered that I already had a script named Low Profile Diacritics.xml, which you probably created, that looked like what I had in mind. Although I did not understand what the <MetricsWidth> part was about it seemed harmless enough so I left it in. (perhaps I should have changed the 1024 to 2048 if it has anything to do with the funits per em but the widths seemed normal enough)

The accents were created in the PUA as expected and they were all very near the x-height line. However, they did not compose with the small caps as hoped … they were all floating above the Cap-height and even the bottom ones which fit perfectly previously were now too high when I ran the Petite Capitals Private Use script! I left them low before running the second script because, "Although they are only used with uppercase, they should be positioned vertically for lowercase. FontCreator will move them up for uppercase, the same as it does with regular accents."
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

Failing to find any more concrete information in the manual, I tried one more ploy:
After creating the low-profile diacritics in the PUA, I moved all of the upper marks down well below the x-height level and I left the dot and comma below below the baseline where they belong. After running the Petite Capitals in the PUA script, I found that the top marks had move to a position above the x-height, not quite as unacceptably high as previously (yay!) but the lower marks had moved up for some unknown reason! Is there any reference material for the scripting language available? I saw that in another script, you were able to raise arrows to a specific height.
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

The best I could manage with the positioning of the accents was to move all of the high accents down by 440 after creating them with the Low Profile Diacritics script. This put them well below the x-height and when the Petite Capitals Private Use script was executed, these accents were moved up above the x-height line but still below the Cap-height. Leaving them as they were created by the Low Profile Diacritics always resulted in them being moved up above the Cap-height. As for the low accents, all of them were also moved upwards by the Petite Capitals Private Use script (why, I do not know) and each had a Y position value of 410 in the Composite Glyph Properties window and returning that value to zero put the accents back where they were after the Low Profile Diacritics ran.

Maybe the only way to correct this would be to alter the <Pos>Auto</Pos> line in the CompositeData script however, I suspect that this line is also responsible for raising the accents above the x-height when they are below it as well as being responsible for raising them above the Cap-height when they are below that level.
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Petite Capitals script

Post by Bhikkhu Pesala »

As my screenshot shows, the Y position of the lowprofile diacritics is zero.

Please attach your CompositeData.xml file and Petite Capitals Transform script from AppData. Zip them together with your font project if you're willing to share that.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

I have bundled the font project with the versions of CompositeData and Petite Capitals Private Use which I used. I also included a brief note on what transpired and noted the accent marks I added in order to get a complete run. Even the oriiginal scale factors have been left in the original file but I have also included my scale and bold factors in the note.

On the first run, the accents looked pretty good where they were succesful but that changed after I added the missing accents. You will also notice that the thorn @ 58254 has not been scaled down which is something I "corrected" in my Petite Capitals script but I did not touch it here … not wanting to add another layer of changes that might cloud the situation.

Thanks in advance for taking a look … I trust that you will quickly see what I do not.

PS I am unable to attach my zip file here . . . I'll try through messaging.
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

Maybe this time it will work . . .
TestBed.7z
(122.87 KiB) Downloaded 257 times
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Petite Capitals script

Post by Bhikkhu Pesala »

A few observations:
  1. The acute and grave accents are in the right position, but the other modifier accents from circumflex to hungarumlaut are below the x-height. The usual position is about half-way between the x-height and CapHeight metric lines.
  2. None of the accented glyphs are composites. If you use Complete Composites on Agrave to Aring, and agrave to aring you will immediately see the problem with the positioning of the modifier accents
  3. The scale factor for the Petite Capitals is too small for your font. The height of the H Petite Caps is 804 funits while the x-height of the font is 956 funits. There is no rule that says they must be the same height, but that is the usual design of Petite Capitals
  4. The Lowprofile Diacritics script will generate accents from the base modifier accents. If the base accents are too low, the low profile accents will be in the wrong vertical position too, even if the Petite Capitals are not smaller than usual. Manually scale the low profile accents to suit their intended use: whether that's for Small Capitals, Petite Capitals, or for Regular Capitals. Compose the regular capitals before creating the low profile accents if you wish to use regular sized accents with the regular capitals.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Petite Capitals script

Post by Bhikkhu Pesala »

Here is a quick edit of your font to show what I would do with it. I adjusted the scale factor for Petite Caps to 73 horizontal and 69.10 vertical.

Take a look, then adapt your scripts to suit whatever you need. After running the Petite Capital script you should manually adjust the serifs, which will be too heavy for the scaled down glyphs.

Open the Notes Panel (F2) to see what I did.
Attachments
2K testbed fixed.fcp
(150.53 KiB) Downloaded 234 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

Thanks for the super-fast response , Bhikkhu

Here are some super-fast comments on you notes before I digest the entirety of your comments:

1. The low modifier accents were left over from an experiment which I mentioned earlier … at one time they actually wound up in the correct position just above the x-height after running the Petite Capitals script.

2. The scale factors which resulted in the very small petite capitals were in the original PC script. The factors which I used were included in the notes. They produced a x-height exactly 70% of the cap height.

My intention was to provide the original font and scripts which I used to create my mess … I know that some of my "corrections" only added to the problems.

PS. As for the multiple zip file uploads; twice I got the message "File not uploaded" and saw no upload activity happening on my end. Yeah, easy! At other tries, I was told that I was attempting to "open" the zip file and asked if I wanted to save it or open it.
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

While I was working on this project and you mentioned the Low Profile Diacritics (LPD) script, I was under the impression that it was an optional procedure to be employed where there was not enough room for the accents … after running the Petite Capitals Private Use (PDPU) script, the accents were far from being crowded! Before the PCPU was run, the accents were pretty normal in the Latin -1 Supplement area. Note the expected contents of 222 & 223:
Before PCPU script 01.png
Before PCPU script 01.png (30.01 KiB) Viewed 9243 times
After running the PCPU script, the accents on the lower case letters were slipping a bit and something was very wrong with 222 & 223:
After PCPU script 01.png
After PCPU script 01.png (31 KiB) Viewed 9243 times
In the PUA the accents were way out of place. 58223, 58331 & 58339 were the expected small capitals however, 58254 was not reduced in size as it should have been.
After PCPU script 02.png
After PCPU script 02.png (30.91 KiB) Viewed 9243 times
So, obviously we have more than just accents gone wild here.
I decided to see what the LPD script would do and in addition to adding12 more diacritics, two of which seem to be duplicates, when I composed 192 thru 231 I got the same results as shown above after running the PCPU script. And again, all of the top accents in the PUA were pushed up over the cap height.
last dance.png
last dance.png (13.31 KiB) Viewed 9243 times
I really do not want anyone to "fix" this for me ... I want to understand how it all ties together. I will look at your rendition tomorrow . . . I have had it for tonight :)

I see that my images are too large, sorry, I reduce them by 60% next time 8)
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: Petite Capitals script

Post by Bhikkhu Pesala »

Leon Gauthier wrote: Fri Aug 17, 2018 6:26 amI was under the impression that it was an optional procedure to be employed where there was not enough room for the accents`
The low profile accents are optional for uppercase accented glyphs to save space. These smaller accents are also better suited for use with Petite Capitals.
After running the PCPU script ... something was very wrong with 222 & 223:
Running the PUA Petite Capitals script won't have this result. This happens only if you wish to use complete composites on these characters as an aid to design if your font does not yet have contours for these glyphs. Decompose them, and use the knife tool and get union of contours to complete the glyphs.
In the PUA the accents were way out of place. 58223, 58331 & 58339 were the expected small capitals however, 58254 was not reduced in size as it should have been.
The lowprofile diacritics should be in the same vertical position as regular accents, but should be scaled down to be 80% or so smaller. They will be in the right position for x-height Petite Capitals.
I decided to see what the LPD script would do and in addition to adding12 more diacritics, two of which seem to be duplicates.
lowprofileinvertedbreve needs to be inverted after generation.
And again, all of the top accents in the PUA were pushed up over the cap height.
All accents are raised for capital letters by the difference between x-height and CapHeight.
In your font that is 1366 - 956 = 410 funits. That is why they must be positioned vertically for lowercase.

Horizontal alignment is automatic. Diaresis, Tilde, Macron, Breve, Circumflex, Dotaccent are all centred over the base glyph. Grave accent is offset to left of centre, and Acute accent is offset right of centre.

The lowercase a in your font has an optical centre that is not in the centre of the contour. In my fixed version, I added a contour with two nodes to adjust the physical centre to match the optical centre.
Physical Centre.png
Physical Centre.png (23.33 KiB) Viewed 9236 times
Adjusted Optical Centre.png
Adjusted Optical Centre.png (23.36 KiB) Viewed 9236 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

Running the PUA Petite Capitals script won't have this result. This happens only if you wish to use complete composites on these characters as an aid to design if your font does not yet have contours for these glyphs. Decompose them, and use the knife tool and get union of contours to complete the glyphs.
You are right, the PCPU script could not produce what I showed above in After PCPU script 01.png. It could only have happened if I had composed those characters. The contours for both of these characters do exist in the original font file. Granted, they do look exactly as they would if you had "composed" them from existing glyphs (and that may well have happened at some point in time) but, right now, they are simple contours that, like we humans, do not have a clue as to their origins. So, "complete composites" may be seen as a weapon of mass de-construction because it blindly overwrites prior creations.

Yes, your "fix" looks good and there are only a few items I might question but the main thing I am interested in now is why your accents came out where the are supposed to and when I run the PCPU script, they are all above the capital height. As you instructed, I had placed mine at exactly the same height you had yours. In fact, in one attempt I actually copied your accents into my project and they still went through the roof.
Leon Gauthier
Posts: 127
Joined: Thu May 07, 2015 6:07 am

Re: Petite Capitals script

Post by Leon Gauthier »

My umpteenth shot at getting this right . . .
Final Attempt40.png
Final Attempt40.png (15.65 KiB) Viewed 9210 times
On the Petite characters, the accents are above the cap height which means that they will have to be adjusted manually. The good news, I got the pesky SS Þ Ŋ & Œ petite capitals correct!
Post Reply