Bitmap image background: reimporting from FLS to RoboFont?



  • For some projects, I'm looking for a way to reimport background bitmap images from a .vfb file into its .ufo in RoboFont. When I export my .ufo from FLS, the images get stripped off the file as you know. Is there a way to reimport the images and have them placed at the same scale and position as in the original .vfb file?
    Thank you for you help, it's not urgent matter and I hope you're enjoying a deserved break in the sun, Frederik!


  • admin

    He

    Form the FL side I don't know what kind of data image.data object is and how to get the transform matrix. (see http://www.e-font.de/flpydoc/ )

    But once it is exported you can add the each image easily with glyph.addImage("path/to/my/image").
    If you would know the scale, rotate or the transform matrix you could easily transform the image:

    glyph.image.scale(x, y)
    glyph.image.rotate(45)
    glyph.image.transform([1, 0, 0, 1, 1, 1]) # with a transform matrix
    

    see http://doc.robofont.com/api/robofab-extras/

    good luck



  • Yo,

    Thank you for the hint. Although I did some visual overall scaling and shifting in FLS, using a script, once I've found the right settings in RoboFont, I'll manage to reimport all my images.

    Best