Giter VIP home page Giter VIP logo

piksels's Introduction

#Piksels example1

make a variable font with pixels

I want to teach you how you can make your own variable pixel fonts in kinda a workshop way.

basic

Everyone with a basic type design knownledge should understand it. I will provide resources and examples.

You need:

How to

  1. Create a pixel
  2. Draw a font
  3. Create interpolating pixels
  4. Create a variable font

Draw a pixel

Make a new font and create a glyph named 'pixel' Draw a shape near or at the origin. This is just a pixel to draw the font, no fancy looking shape is required, just a rectangle will do.

# in code it looks like
# create a new font, create a glyph, draw a shape
f = NewFont("Piksels", "mystyle")
g = f.newGlyph("pixel")
pen = g.getPen()
d = 100
pen.moveTo((0,0,))
pen.lineTo((d,0))
pen.lineTo((d,d))
pen.lineTo((0,d))
pen.closePath()

Draw a font

If not already present, add some basic glyphs to the font:

# this script add template glyphs A-Z to the CurrentFont
import string
basicCaps = string.ascii_uppercase

f = CurrentFont()
glyphOrder = list(f.lib['public.glyphOrder'])
for glyphName in basicCaps:
    if glyphName not in glyphOrder:
        glyphOrder.append(glyphName)
f.glyphOrder = glyphOrder

Open a glyph, select PixelTool, right-click in the GlyphView and set the correct settings: Set Component to 'pixel' and the Pixel Size = 100 if you followed the example above. If you drew a smaller/larger pixel, than use your size!

Now it is just drawing.

Create interpolating pixels

In this example I create 4 pixels.

newPixels = [
  'pixel.0',
  'pixel.100',
  'pixel.101',
  'pixel.200',
]
f = CurrentFont()
glyphOrder = list(f.lib['public.glyphOrder'])
for glyphName in newPixels:
    if glyphName not in glyphOrder:
        glyphOrder.append(glyphName)
f.glyphOrder = glyphOrder

The number after the period in the glyph name, will be the location on the variable axis later.

Keep in mind that all these pixels need to interpolate. You can 'trick' the system to place two location right next to each other, like I did: 100,101.

Place an anchor in the glyph. This will be the rotating point for the rotate axis.

See the Example.ufoz for an -well- example.

Create a variable font

super easy:

  1. Run the script HalloType_Piksels_mainScript.py: open it in RoboFont, have the font open and make sure it is the CurrentFont. At the top of the script there are some parameters for the axes you can add the variable font. Run the script. The script will analyse the font and create Piksels.designspace. Also, all the sources for the designspace will be generated in the sources folder.
  2. Open the project folder in Terminal and type make. Now the variable font is generated! Find Piksels.ttf in the folder!
  3. Done!

What now?

Soon: DrawBot variable font tutorial.

piksels's People

Contributors

hallotype avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.