<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Can “default” checkboxes in font info actually store that value in the UFO?]]></title><description><![CDATA[<p dir="auto">Currently the "default value" checkboxes in font info only flag to internal RF processes to auto-generate a default value in that field upon generate.</p>
<p dir="auto">Problem: if running processes external to RF (FDK generation in Terminal for instance), those values aren't written into the UFO and can therefore raise a flag.</p>
<p dir="auto">Could the "default value" checkbox just store the actual value in the UFO when checked?</p>
<p dir="auto"><img src="/assets/uploads/files/1578943864710-0fa844ee-0245-4d32-92d2-02129083ddcf-image.png" alt="0fa844ee-0245-4d32-92d2-02129083ddcf-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Currently writing a script to write it to the UFO on save, but seems messy.</p>
<p dir="auto">TIA,<br />
Ryan</p>
]]></description><link>https://forum.robofont.com/topic/786/can-default-checkboxes-in-font-info-actually-store-that-value-in-the-ufo</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 02:39:30 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/786.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Jan 2020 19:32:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Wed, 15 Jan 2020 23:01:36 GMT]]></title><description><![CDATA[<p dir="auto">Currently the "default value" checkboxes in font info only flag to internal RF processes to auto-generate a default value in that field upon generate.</p>
<p dir="auto">Problem: if running processes external to RF (FDK generation in Terminal for instance), those values aren't written into the UFO and can therefore raise a flag.</p>
<p dir="auto">Could the "default value" checkbox just store the actual value in the UFO when checked?</p>
<p dir="auto"><img src="/assets/uploads/files/1578943864710-0fa844ee-0245-4d32-92d2-02129083ddcf-image.png" alt="0fa844ee-0245-4d32-92d2-02129083ddcf-image.png" class="img-responsive img-markdown" /></p>
<p dir="auto">Currently writing a script to write it to the UFO on save, but seems messy.</p>
<p dir="auto">TIA,<br />
Ryan</p>
]]></description><link>https://forum.robofont.com/post/2987</link><guid isPermaLink="true">https://forum.robofont.com/post/2987</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 15 Jan 2020 23:01:36 GMT</pubDate></item><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Mon, 13 Jan 2020 22:37:38 GMT]]></title><description><![CDATA[<p dir="auto">the default values are calculated by <a href="https://github.com/robotools/ufo2fdk/blob/master/Lib/ufo2fdk/fontInfoData.py#L520" rel="nofollow">ufo2fdk getAttrWithFallback</a></p>
<pre><code class="language-python">from ufo2fdk.fontInfoData import getAttrWithFallback
from defcon import Info

info = Info()
info.descender = -250
print(getAttrWithFallback(info, "openTypeOS2WinDescent"))
info.openTypeOS2WinDescent = 350
print(getAttrWithFallback(info, "openTypeOS2WinDescent"))
</code></pre>
<p dir="auto">also see the <a href="https://github.com/robotools/defconAppKit/blob/master/Lib/defconAppKit/controls/fontInfoView.py#L12" rel="nofollow">defconAppKit fontInfoView</a></p>
]]></description><link>https://forum.robofont.com/post/2990</link><guid isPermaLink="true">https://forum.robofont.com/post/2990</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Mon, 13 Jan 2020 22:37:38 GMT</pubDate></item><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Tue, 14 Jan 2020 18:00:50 GMT]]></title><description><![CDATA[<p dir="auto">What keeps you from just saving the value (such as the PS font name) into the UFO? Check the box once and you’re done.<br />
Does the font name change that often? ;-)</p>
<p dir="auto">FWIW, I’d rather confirm some of Robofont’s suggestions by unchecking the ✅ <code>Use Default Value</code> box, than hunting for “helpfully” set default values in my UFO file.</p>
<p dir="auto">So – please reconsider your suggestion! :-)</p>
]]></description><link>https://forum.robofont.com/post/2991</link><guid isPermaLink="true">https://forum.robofont.com/post/2991</guid><dc:creator><![CDATA[frankrolf]]></dc:creator><pubDate>Tue, 14 Jan 2020 18:00:50 GMT</pubDate></item><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Tue, 14 Jan 2020 21:53:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/250">@frankrolf</a> I'm often working with variable fonts in a quick-and-dirty fashion, versioning, potentially delivering variable logotypes to clients to test. Can get messy very fast, and a mismatched set of ps names can be a confusing speed bump. The only thing I'm trying to avoid is postscript names being <em>empty</em> when needed externally of RF. Is there a disadvantage to—when changing family name and style name in Font Info, with default checkboxes checked—ps names being stored in the ufo?</p>
<p dir="auto">I've experienced this for a while, and am only now surfacing it because the confusion recently came up amongst friends.</p>
<p dir="auto">In the meantime, prior to any replies here, I wrote a pretty clunky script (should potentially rewrite once I understand above reply) to keep this updated. Would love to not need something like this.</p>
<pre><code>from mojo.events import addObserver

class postScriptFontNameGen:
    
    def __init__(self):
        
        addObserver(self, "psNameChange", "fontDidSave")
        
    def psNameChange(self, notification):
        f = notification["font"]
        
        # set postscript names
        if f.info.familyName != None and f.info.styleName != None:

            attributes = {
                'postscriptFontName': str(f.info.familyName + "-" + f.info.styleName).replace(" ", ""),
                'postscriptFullName': str(f.info.familyName + f.info.styleName).replace(" ", "")
                }
            for attr, value in attributes.items():
                setattr(f.info, attr, value) 
        
        # set postscript weight name
        if f.info.openTypeOS2WeightClass != None:
            ranges = {
                    100: "Thin",
                    200: "Extra-light",
                    300: "Light",
                    400: "Normal",
                    500: "Medium",
                    600: "Semi-bold",
                    700: "Bold",
                    800: "Extra-bold",
                    900: "Black",
                    }
            os2_w = f.info.openTypeOS2WeightClass  
            f.info.postscriptWeightName = "Thin"      
            for attr, value in ranges.items():
                if os2_w &gt;= attr:
                    f.info.postscriptWeightName = value
        else:
            f.info.postscriptWeightName = "Normal"
                
        f.save()
                
                
postScriptFontNameGen()
</code></pre>
]]></description><link>https://forum.robofont.com/post/2992</link><guid isPermaLink="true">https://forum.robofont.com/post/2992</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Tue, 14 Jan 2020 21:53:14 GMT</pubDate></item><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Wed, 15 Jan 2020 11:32:19 GMT]]></title><description><![CDATA[<p dir="auto">hello <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/224">@ryan</a>,</p>
<blockquote>
<p dir="auto">Is there a disadvantage to—when changing family name and style name in Font Info, with default checkboxes checked—ps names being stored in the ufo?</p>
</blockquote>
<p dir="auto">I think so: it goes against the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="nofollow">DRY principle</a> and would actually <em>increase</em> the chance of mismatched data down the line (for example if <code>familyName</code> or <code>styleName</code> are changed with a script or without the checkbox).</p>
<p dir="auto">if you generate the fonts with <code>font.generate</code> or with <code>ufo2fdk.OTFCompiler</code>, all default values are calculated automatically for you. this is very convenient. special cases can be handled with a script, as you’re doing.</p>
<p dir="auto">below is a modified version of your script, which stores the default values in the font when it is saved. it uses <code>getAttrWithFallback</code> to calculate the defaults. (I’ve added a window to toggle it ON/OFF while testing)</p>
<pre><code class="language-python">from ufo2fdk.fontInfoData import getAttrWithFallback
from vanilla import FloatingWindow, CheckBox
from mojo.events import addObserver, removeObserver
from defconAppKit.windows.baseWindow import BaseWindowController

class psNameGenerator(BaseWindowController):
    
    def __init__(self):
        self.w = FloatingWindow((123, 44))
        self.w.button = CheckBox((10, 10, -10, 24), 'activate', value=False, callback=self.toggleObserverCallback)
        self.setUpBaseWindowBehavior()
        self.w.open()

    def psNameChange(self, notification):
        f = notification["font"]
        psNames = ['postscriptFontName', 'postscriptFullName', 'postscriptWeightName']
        print(f'saving {f.info.familyName} {f.info.styleName}...\n')
        for psName in psNames:
            value = getAttrWithFallback(f.info, psName)
            setattr(f.info, psName, value)
            print(f'\t{psName}: {getattr(f.info, psName)}')
        f.save()
        print('\n...done.\n')

    def toggleObserverCallback(self, sender):
        if sender.get():
            print('observer is ON\n')
            addObserver(self, "psNameChange", "fontDidSave")
        else:
            print('observer is OFF\n')
            removeObserver(self, 'fontDidSave')

    def windowCloseCallback(self, sender):
        removeObserver(self, 'fontDidSave')
        super(psNameGenerator, self).windowCloseCallback(sender)
                
psNameGenerator()
</code></pre>
<p dir="auto">hope this makes sense… cheers!</p>
]]></description><link>https://forum.robofont.com/post/2995</link><guid isPermaLink="true">https://forum.robofont.com/post/2995</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Wed, 15 Jan 2020 11:32:19 GMT</pubDate></item><item><title><![CDATA[Reply to Can “default” checkboxes in font info actually store that value in the UFO? on Wed, 15 Jan 2020 16:29:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/22">@gferreira</a> Makes sense, thanks very much!</p>
]]></description><link>https://forum.robofont.com/post/2999</link><guid isPermaLink="true">https://forum.robofont.com/post/2999</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 15 Jan 2020 16:29:02 GMT</pubDate></item></channel></rss>