<?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[Why can’t font overview cell size be “float”?]]></title><description><![CDATA[<p dir="auto">If I try to set the cell size to a float...</p>
<pre><code class="language-python">from mojo.UI import CurrentFontWindow

v = CurrentFontWindow().fontOverview.getGlyphCollection()

v.getGlyphCellView().setCellSize_((40.5, 40.5))

cs = v.getCellSize()
vw = v.getGlyphCellView().frameSize().width
vh = v.getGlyphCellView().frameSize().height

print(cs)
print(vw, vh)
</code></pre>
<p dir="auto">it returns the following. Cell size is a whole number while frame size can be float.</p>
<p dir="auto"><code>(40, 40)</code><br />
<code>479.0 561.5</code></p>
<p dir="auto">Since the cells are within the frame, I think it'd be useful for their dimensions to be more precise than that of the frame.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.robofont.com/topic/867/why-can-t-font-overview-cell-size-be-float</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 07:46:01 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/867.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 May 2020 17:48:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Tue, 19 May 2020 09:37:15 GMT]]></title><description><![CDATA[<p dir="auto">If I try to set the cell size to a float...</p>
<pre><code class="language-python">from mojo.UI import CurrentFontWindow

v = CurrentFontWindow().fontOverview.getGlyphCollection()

v.getGlyphCellView().setCellSize_((40.5, 40.5))

cs = v.getCellSize()
vw = v.getGlyphCellView().frameSize().width
vh = v.getGlyphCellView().frameSize().height

print(cs)
print(vw, vh)
</code></pre>
<p dir="auto">it returns the following. Cell size is a whole number while frame size can be float.</p>
<p dir="auto"><code>(40, 40)</code><br />
<code>479.0 561.5</code></p>
<p dir="auto">Since the cells are within the frame, I think it'd be useful for their dimensions to be more precise than that of the frame.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.robofont.com/post/3323</link><guid isPermaLink="true">https://forum.robofont.com/post/3323</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Tue, 19 May 2020 09:37:15 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Tue, 19 May 2020 15:12:44 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>
<p dir="auto">the cell size must be an <code>int</code> because it is the number of pixels in the bitmap representations.</p>
<p dir="auto">cheers!</p>
]]></description><link>https://forum.robofont.com/post/3324</link><guid isPermaLink="true">https://forum.robofont.com/post/3324</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Tue, 19 May 2020 15:12:44 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Wed, 20 May 2020 12:59:00 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/22">@gferreira</a>. I see where you're coming from. Maybe I can show you a sample of what I'm trying to do. There may be another solution I'm not seeing.</p>
<pre><code class="language-python">from mojo.UI import CurrentFontWindow

'''
trying to perfectly fit 16 columns of cells across the font overview
'''

gc = CurrentFontWindow().fontOverview.getGlyphCollection()
v = gc.getGlyphCellView()

# get the width of the cell view
vw = v.frameSize().width

cells_across = 16
cw = vw / cells_across

print("frame width is ", vw)
print("and the amount of cells I want across is ",  cells_across)
print("so: ")
print("desired cell size is ",  cw)

# do it
v.setCellSize_([cw, cw])

new_cw = gc.getCellSize()[0]

print("but resulting cell size is ", new_cw)
print("so: ")
print("leftover padding on right side of font overview is ", ((cw - new_cw) * cells_across))
</code></pre>
<pre><code class="language-console">frame width is  536.0
and the amount of cells I want across is  16
so: 
desired cell size is  33.5
but resulting cell size is  33
so: 
leftover padding on right side of font overview is  8.0
</code></pre>
<p dir="auto">Resulting font overview with leftover space on the right is shown below. I've also tried resizing the font overview itself, but for some reason it needs to be re-run a few times before it <em>almost</em> hits flush with the cells. I'd love to be able to solve this without resizing the font overview itself.<br />
<img src="/assets/uploads/files/1589903101613-screen-shot-2020-05-19-at-11.44.23.png" alt="Screen Shot 2020-05-19 at 11.44.23.png" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.robofont.com/post/3327</link><guid isPermaLink="true">https://forum.robofont.com/post/3327</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 20 May 2020 12:59:00 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Tue, 19 May 2020 17:01:06 GMT]]></title><description><![CDATA[<p dir="auto">Each cell is an image and images can not have float dimensions...</p>
<p dir="auto">See <a href="https://github.com/robotools/defconAppKit/blob/master/Lib/defconAppKit/representationFactories/glyphCellFactory.py#L12" rel="nofollow">https://github.com/robotools/defconAppKit/blob/master/Lib/defconAppKit/representationFactories/glyphCellFactory.py#L12</a></p>
<p dir="auto">Resize the window by 8? (Untested..)</p>
]]></description><link>https://forum.robofont.com/post/3328</link><guid isPermaLink="true">https://forum.robofont.com/post/3328</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Tue, 19 May 2020 17:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Tue, 19 May 2020 17:04:13 GMT]]></title><description><![CDATA[<p dir="auto">there’s a script to resize the window in <a href="http://forum.robofont.com/topic/752/fill-extra-space-in-font-overview?_=1589907236428" rel="nofollow">Fill extra space in font overview</a></p>
]]></description><link>https://forum.robofont.com/post/3329</link><guid isPermaLink="true">https://forum.robofont.com/post/3329</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Tue, 19 May 2020 17:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Tue, 19 May 2020 17:59:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/22">@gferreira</a> <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/1">@frederik</a></p>
<p dir="auto">If I go with the window resizing thing, there's another problem where the script needs to be run multiple times. I thought it had to do with the scrollbar at first, but I changed my settings, and it's not there anymore.<br />
<a href="https://www.dropbox.com/s/nqlpsjre79jy2cn/fo%20resize.mov?dl=0" rel="nofollow">Video here.</a><br />
<a href="https://gist.github.com/ryanbugden/6c4048f3199fba63204df6eb357d9e00" rel="nofollow">Code here.</a></p>
]]></description><link>https://forum.robofont.com/post/3330</link><guid isPermaLink="true">https://forum.robofont.com/post/3330</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Tue, 19 May 2020 17:59:37 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Wed, 20 May 2020 23:08:15 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>
<p dir="auto">I gave it a try, this seems to work (very nice btw :)</p>
<pre><code class="language-python">from mojo.UI import CurrentFontWindow

cells = 8

fontWindow = CurrentFontWindow()
fontOverview = fontWindow.fontOverview
cellView = fontOverview.getGlyphCollection().getGlyphCellView()
frameWidth = cellView.frameSize().width

cellSize = int(frameWidth / cells)

# set cell size
cellView.setCellSize_([cellSize, cellSize])

# resize cell view
frameWidthNew = cells * cellSize
xDiff = frameWidth % cellSize
L, T, W, H = fontWindow.window().getPosSize()

if fontWindow.doodleWindowName == 'SingleFontWindow':
    x, y, w, h = fontOverview.getPosSize()
    fontWindow.editor.splitView.setDimension('fontOverview', frameWidthNew)
    fontWindow.editor.splitView.setDimension('glyphView', W - frameWidthNew)
    fontWindow.centerGlyphInView()

else: # FontWindow
    fontWindow.window().setPosSize((L, T, W - xDiff, H), False)
</code></pre>
<p dir="auto">to do: update the cell size slider at the bottom</p>
<p dir="auto">cheers!</p>
]]></description><link>https://forum.robofont.com/post/3343</link><guid isPermaLink="true">https://forum.robofont.com/post/3343</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Wed, 20 May 2020 23:08:15 GMT</pubDate></item><item><title><![CDATA[Reply to Why can’t font overview cell size be “float”? on Wed, 20 May 2020 23:57:28 GMT]]></title><description><![CDATA[<p dir="auto">Thanks so much, <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/22">@gferreira</a>, this solves it perfectly in SWM!! I wouldn't have figured out <code>setDimension</code> x2 in splitView + <code>centerGlyphInView()</code>.</p>
<p dir="auto">And yes the main tool has <code>fontOverview.views.sizeSlider.set()</code> :))</p>
<p dir="auto">I've flowed in your solve. Feel free to play with the real tool <a href="https://github.com/ryanbugden/Fit-Glyph-Cells" rel="nofollow">here</a>.</p>
]]></description><link>https://forum.robofont.com/post/3344</link><guid isPermaLink="true">https://forum.robofont.com/post/3344</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 20 May 2020 23:57:28 GMT</pubDate></item></channel></rss>