[Sugar-devel] [GSOC] Font Editor Next Steps

Dave Crossland dave at lab6.com
Sun May 22 18:54:43 EDT 2016


Hi

On 22 May 2016 at 18:20, Yash Agarwal <agrwal.ysh94 at gmail.com> wrote:
>
> On Mon, May 23, 2016 at 3:32 AM Dave Crossland <dave at lab6.com> wrote:
>
>>
>> Hi
>>
>> On 22 May 2016 at 17:50, Yash Agarwal <agrwal.ysh94 at gmail.com> wrote:
>>
>>> Thanks for the feedback Dave!
>>> I've made the changes to the proposal
>>> <https://sugarlabs.github.io/edit-fonts-activity/latest-proposal> as
>>> per your comments
>>>
>>
>> Thanks!
>>
>>
>>> I need help/advice regarding a few things:
>>> I'm going to ask them here and then make a compiled blog post in a
>>> question-answer format once we sort them out. IMHO this will be a better
>>> way to document this.
>>>
>>
>> Sounds good :)
>>
>>
>>> [WORKING WITH FONTS INSIDE SUGAR]
>>> I found much of the info regarding loading fonts and using them to
>>> format a text string in Gonzalo
>>> Odiard's
>>>  code
>>> <https://github.com/sugarlabs/edit-fonts-activity/blob/master/activity.py> (which
>>> was a great read :D) . But this Activity only lists the current fonts in
>>> the system and to make a proper font manager I need to know the following:
>>>
>>>    1. Where are fonts stored in sugar and what format they are stored
>>>    in?
>>>
>>> You can find the locations of ttfs on a GNU system by running,
>>
>>     $ locate ttf
>>
>> https://wiki.sugarlabs.org/go/The_Undiscoverable/Fonts mentions that
>> users can store fonts in ~/.fonts/ and that the FontConfig cache tool must
>> be used when fonts are copied into there to update the FontConfig database.
>>
>> http://www.sanfoundry.com/fc-cache-command-usage-linux/ explains this a
>> little more.
>>
>>
>>>
>>>    1. How to install/uninstall (or Activate/Deactivate) fonts both at
>>>    runtime Activity(if we can) and externally(using Ubuntu)?
>>>
>>> I suggest checking the source code of https://fontmanager.github.io :)
>>
>>
>>>
>>>    1. if we are going to make collections of fonts and marking some
>>>    fonts as favorites where should these setting be saved?
>>>
>>> That's a great question that I don't know, but I hope experienced Sugar
>> developers can answer :)
>>
>>
>>> [MAKING A GLYPH PICKER INTERFACE]
>>> **A grid layout of all the Glyphs within a font like this
>>> <https://raw.githubusercontent.com/sugarlabs/edit-fonts-activity/gh-pages/files/img/3.png>
>>>  **
>>>
>>>    1. How should we render the Glyphs in the boxes, using Gtk-Cairo or
>>>    through Pango which will require the font to be installed as a .ttf maybe?
>>>
>>> Since this is about the font editor part of the application, the glyphs
>> will be defcon objects, and thus need to be rendered with Cairo as drawings
>> rather than with Pango as binary fonts.
>>
>
>>
>>
>>> [MAKING A GLYPH EDITING INTERFACE]
>>> **A drawing area where we can edit the Glyphs within a font like this
>>> <https://raw.githubusercontent.com/sugarlabs/edit-fonts-activity/gh-pages/files/img/4.png>
>>>  **
>>>
>>>    1. Should the Glyphs be rendered in this using Cairo?
>>>
>>>
>> Yes.
>>
>>
>>>
>>>    1. if yes then should I write my own method for this or is there
>>>    something inbuilt in Cairo or a 3rd party lib for reading ufo3's
>>>    .glif files?
>>>
>>> defcon reads the UFO (and thus its GLIF files) and loads their bezier
>> outlines as python objects, so you can use pycairo to render them.
>>
>
> Oh, I said reading, I meant for rendering them.
> defon only gives the data as objects which can contain multiple
> components/countours and writng methods/classes for that will be a bit
> complex
>
I think this will be a major part of my GSoC. ;)
>

I'm optimistic that you can crack it within a week, since you have defconQt
(and the ufoJS glifrendered.html) as a reference that you can port :)

https://github.com/trufont/trufont/tree/master/Lib/trufont

https://github.com/adrientetar/defconQt/tree/master/Lib/defconQt

To break it down into stages, I suggest ignoring the contours in the first
stage and focus on contours.

If you want to revise your project plan, please do :)


> I found these links quite useful for getting started with Cairo
>>>
>>>
>>>    - http://www.tortall.net/mu/wiki/CairoTutorial
>>>       - http://zetcode.com/gfx/pycairo/basicdrawing/
>>>
>>> :)
>>
>>
>>> [regarding the way FONTS ARE MODELED in UFOv3
>>> <http://unifiedfontobject.org/versions/ufo3/index.html>]
>>>
>>>    1. why do we need multiple layers in a font?(to store multiple
>>>    families..?)
>>>
>>> When drawing anything it is useful to have reference material close to
>> hand. Almost all graphics editors have layers for this purpose -
>> gimp/photoshop, inkscape/illustrator, scribus/indesign, etc etc.
>>
>>
>>>
>>>    1. why do we need to group glyphs? (is it only for Kearning?)
>>>
>>> Yes, http://unifiedfontobject.org/versions/ufo3/groups.plist/  says,
>>
>> "Groups may be used as members of kerning pairs in kerning.plist."
>>
>>
>>>    1. why do we need the image files?(are they used to render the
>>>    glyphs?)
>>>
>>> Which image files?
>>
> this one  http://unifiedfontobject.org/versions/ufo3/images/
> and the image xml element in .glif file.
> http://unifiedfontobject.org/versions/ufo3/glyphs/glif/
>

The idea is similar to layers - you might sketch some letter designs with a
pencil - eg https://glyphsapp.com/tutorials/sketching - and then scan the
paper you drew on, segment it into one image per letter, and then want to
draw digital outlines with the image integrated into your drawing canvas.

BTW https://glyphsapp.com/tutorials/monoline is also nice, relates to the
'stretch goals' in your plan at the end :)

-- 
Cheers
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20160522/a94dd984/attachment-0001.html>


More information about the Sugar-devel mailing list