Bold assignment doesn't work in Keynote

I just uploaded a version that should fix the familyName parameter

Wheee! Thanks Georg, you’re the best. :blush:

I’m still getting the occasional @Uppercase error message upon export with the new version, but that’s not really a problem.

Hi Georg,

my script to export SC and Unicase fonts no longer works. I think it has to do with the fact that “SC” and “Unicase” are now part of the familyName custom parameter, whereas they were in the instance name before.

I tried this:

for thisInstance in Font.instances:
    if familyNamePart in thisInstance.familyName:
        ...

…but when I execute the script, nothing happens. Does the .familyName method only know about the font’s family name as given in the info dialog, or does it also know about familyName custom parameters for a given instance?

Alternatively, I could move the “SC” and “Unicase” back into the instance name, for which I have a working script solution. However, then I’d have to be able to overwrite those instance names with new ones (without the SC and Unicase labels) via a custom parameter upon export. Is there a custom parameter to set the instance name? instanceName doesn’t seem to be recognized.

If I print stuff in a Python script, where does the output go? That would be helpful for debugging.

this should be fixed in the latest versions. The familyName property will respect the custom parameter and use the font.familyName otherwise.

Hmm… Then something else is going wrong. Where can I see the output of print commands in a script? Or error messages, for that matter? It’s really hard to debug without feedback.

OK, Mekka told me about the Macro Window. That’s one problem solved.

Now I’m getting the following problem when trying to use familyName:

for thisInstance in Font.instances:
    print thisInstance.familyName
    
<native-selector familyName of <GSInstance "Light" width 100.0 weight 40.0>>
<native-selector familyName of <GSInstance "Regular" width 100.0 weight 48.1762008667>>
<native-selector familyName of <GSInstance "Medium" width 100.0 weight 58.2843017578>>
<native-selector familyName of <GSInstance "Semi" width 100.0 weight 69.3179016113>>
<native-selector familyName of <GSInstance "Bold" width 100.0 weight 80.0>>
<native-selector familyName of <GSInstance "Light" width 100.0 weight 40.0>>
<native-selector familyName of <GSInstance "Regular" width 100.0 weight 48.1762008667>>
<native-selector familyName of <GSInstance "Medium" width 100.0 weight 58.2843017578>>
<native-selector familyName of <GSInstance "Semi" width 100.0 weight 69.3179016113>>
<native-selector familyName of <GSInstance "Bold" width 100.0 weight 80.0>>
<native-selector familyName of <GSInstance "Light" width 100.0 weight 40.0>>
<native-selector familyName of <GSInstance "Regular" width 100.0 weight 48.1762008667>>
<native-selector familyName of <GSInstance "Medium" width 100.0 weight 58.2843017578>>
<native-selector familyName of <GSInstance "Semi" width 100.0 weight 69.3179016113>>
<native-selector familyName of <GSInstance "Bold" width 100.0 weight 80.0>>
<native-selector familyName of <GSInstance "Light" width 100.0 weight 40.0>>
<native-selector familyName of <GSInstance "Regular" width 100.0 weight 48.1762008667>>
<native-selector familyName of <GSInstance "Medium" width 100.0 weight 58.2843017578>>
<native-selector familyName of <GSInstance "Semi" width 100.0 weight 69.3179016113>>
<native-selector familyName of <GSInstance "Bold" width 100.0 weight 80.0>>

When I do the same for thisInstance.name, I get some nice clean strings out. I can also use methods like .startswith() on thisInstance.name, but they fail on thisInstance.familyName. How can I turn those into a string?

The GSInstance class does not have a familyName attribute. What you want is probably something like this:

for thisInstance in Font.instances:
 	parameterFamilyName = thisInstance.customValueForKey_("familyName")
	if parameterFamilyName:
		print parameterFamilyName
	else:
		print Font.familyName

Awesome, that worked! Thanks! :smile:

That is bot true. But it’s not in the wrapper. In this case you need to add a parenthesis. instance.famillyName() (until we add it to the wrapper, then you have to remove it again)

Ooh, I think I finally figured out the original “Bold assignment doesn’t work” problem. I had the Bold Italic declared as “the Italic of Bold”, which didn’t work properly. Now that I’ve declared it as “the Bold of Regular Italic”, it works like a charm. :smile:

Thanks to Andrew M, I’m now also aware of a different problem with the italics: When I use them in a text box in Word and export the document into PDF, the italic glyphs get swapped out with other, more obscure glyphs from the same font. Any idea what could be the reason for that?

Either cache problems, or you have an Add Missing Symbol Glyphs parameter in conjunction with a TTF, which does not work.

I have run the Clear Font Cache script and rebooted before exporting that, though… and I certainly haven’t used the missing symbols thing.

Well, I suppose I can rename the Semi weight back to Semibold now that I know why the assignment didn’t work…

I just did the font cache thing again, and now Word no longer recognizes that my font is installed at all. Font Book, on the other hand, says it is that that it verifies without trouble. What did I break this time? :frowning:

EDIT: Alright, after a few cycles of adding and removing the fonts in Font Book and restarting Word a few times, Word is finally recognizing them again. The PDF export thing remains unchanged, though. Maybe the conversion to PDF uses a different kind of font cache?

Do you recommend using versioned font family names (Cormorant v0.2.11 or so) for testing until the v1 release?

When needing to test with applications that don’t have a per-app/vendor font directory (e.g., Adobe apps), that’s what I do: update the Family Name with a new version number. When ready for release, I remove the version numbering from the Family Name.

I forgot, yes, Word has its own font cache.

Can I manually refresh that?

There is a way to delete the MS Word caches, then log out and back in again. A quick Google search reveals this website: http://www.luther.edu/helpdesk/macfontcache/ Keep in mind that different versions of MS Office may use different font caches.

Thanks, I did that.

Now Word doesn’t know about Calibri anymore. :frowning:

(Never mind, though, I took the opportunity to install Office 2016.)

I guess I’ll include version numbers in my family names for the time being, and when I release the first “final” version, I might call it “Cormorant Pro”. It will likely include some Cyrillic after all. :wink: