# Adafruit Pinguin for EAGLE CAD

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/115/152/medium800/manufacturing_sideside.png?1663536174)

![](https://cdn-learn.adafruit.com/assets/assets/000/115/153/medium800/manufacturing_siderender.png?1663536343)

Autodesk’s **_EAGLE_** — the PCB design software favored around Adafruit — has a problem: the circuit boards it produces, while perfectly&nbsp;_functional,_ are _ **ugly** ,_ with vintage plotter-like text and _no_ font support.

One can’t really fault the software for this…it’s more an artifact of its **age**.&nbsp;When EAGLE was hatched in 1988, circuit boards went _inside_ products, they were rarely products themselves…and if they were, appearances were of minimal concern.

But as the electronics hobby realm grew over time, the aesthetics of these parts became a distinguishing feature. While not the first, the popularity of the Arduino UNO (2010) really put this idea in the public eye, with its on-brand color and typography.

The thing about custom silkscreens is that the process is laborious, and can take _days_ to get everything right.&nbsp;We’ll do that for a popular item like **Circuit Playground**.&nbsp;The custom silk is easier to read and just feels “premium.”

But to do that with _every esoteric sensor breakout board,_ there just aren’t enough hours in the day. It would be _nice_, but isn’t _practical._

![Photo of Circuit Playground Express board](https://cdn-learn.adafruit.com/assets/assets/000/115/145/medium640/manufacturing_cpx-photo.jpg?1663526771)

![Screen capture of silkscreen design process](https://cdn-learn.adafruit.com/assets/assets/000/115/147/medium640/manufacturing_cpx-illustrator.png?1663526787)

 **What if there was a middle ground?** Just a _small push_ that elevates the weakest part of EAGLE’s output?

# Introducing Pinguin

**_Pinguin_** is a Python script that substitutes **TrueType fonts** for EAGLE’s ugly plotter-stroke text. EAGLE currently can’t do this on its own…in fact, if you try even using the built-in “proportional” font (intended only for schematics) on a PCB, those labels are converted to the ugly font on output.

Not a typo, the name’s a portmanteau of _ **pin** _ (since it’s mostly I/O pins that get labeled) and _ **penguin** _ (keeping with the avian motif of _EAGLE_ and other silkscreen-improving projects like [SparkFun’s _Buzzard_](https://www.sparkfun.com/news/2610)).

Pinguin has limitations, as we’ll explain, and probably bugs…it’s far from a perfect solution…but it’s _quick_ and often _good enough_ to dress up boards for better readability.

![Before and after Pinguin comparison of actual physical PCBs](https://cdn-learn.adafruit.com/assets/assets/000/115/753/medium800/manufacturing_pinguin-before-after.jpg?1665173692)

Yes, you can now make PCBs where the silkscreen labeling is in [Papyrus](https://www.youtube.com/watch?v=jVhlJNJopOQ)!

![](https://cdn-learn.adafruit.com/assets/assets/000/115/155/medium800/manufacturing_image.png?1663539554)

# Adafruit Pinguin for EAGLE CAD

## Installation

Pinguin has the following prerequisites:

- **Autodesk EAGLE** PCB design software. If reading this guide, you’re likely already a user… but if not, a [limited free version is available for Windows, Mac and Linux](https://www.autodesk.com/products/eagle/free-download).
- A recent ( **3.X** ) version of **Python** …a standard feature on many systems now (e.g. macOS includes Python 3.7). Type `python -V` from a command prompt and see what you get. If not present, visit [Python.org](https://www.python.org) for installation help.
- The _ **Pillow** _ graphics library. This might already be installed with Python, or you can type:

```terminal
pip install pillow
```

(may require “pip3” or capitalized “Pillow”, but that’s the basic idea.)

[The Pinguin software](https://github.com/adafruit/Adafruit_Pinguin) can be retrieved either via _git_ if you have that installed:

```terminal
git clone https://github.com/adafruit/Adafruit_Pinguin
```

…or by downloading and uncompressing the ZIP archive from GitHub:

[Download Adafruit_Pinguin ZIP Archive](https://github.com/adafruit/Adafruit_Pinguin/archive/refs/heads/main.zip)
You’ll have a folder, **Adafruit\_Pinguin** , containing the **pinguin.py** Python script and a **fonts** subdirectory.

# Adafruit Pinguin for EAGLE CAD

## Using Pinguin

Pinguin is invoked from the command line. It’s an esoteric tool that won’t see widespread use, so please forgive that error handling is minimal. If you encounter trouble that can’t be puzzled out from Python’s traceback messages,&nbsp;ask for help in the [Adafruit Forums](https://forums.adafruit.com), or [open an issue](https://github.com/adafruit/Adafruit_Pinguin/issues) on GitHub if it’s clearly a bug.

At its simplest, Pinguin accepts an EAGLE **.brd** file for input:

```terminal
python pinguin.py /path/to/file/board.brd
```

(You might need “`python3`” on a few systems that keep Python 2.X around for vintage compatibility.)

The output will be a **new .brd file** (the original remains untouched) with “\_out” inserted in the name; e.g.&nbsp;if `board.brd` is the input file, the output will be `board_out.brd`.

 **HERE’S WHAT HAPPENS:**

1. The script looks for any **text objects** in layers **21** (tPlace) and **22** (bPlace) — these are normally the top and bottom **silkscreen** layers.
2. A **TrueType font** is chosen based on the object’s **font** property: **vector** , **proportional** or **fixed**. EAGLE allows selecting “proportional” even though it can’t handle this on output.
3. A high-resolution **raster** equivalent is generated and placed at roughly the same position, either in layer **170** (for top elements) or **171** (bottom).
4. The **original** text object is moved to layer **172** (top) or **173** (bottom) for safekeeping.

Layers **170–173** were chosen as they’re **not normally dedicated to anything** in EAGLE. If you _do_ use any of those layers for something in your own workflow, you’ll want to modify the script (there are global settings near the top).

The new layers **170** & **171** should be included as **silk** when generating EAGLE’s **CAM output**. The backup layers **172** & **173** should be **hidden**.

Here’s what a board might look like before, using the “vector” font, and the output file after processing:

![Side-by-side comparison of standard EAGLE PCB, and after processing](https://cdn-learn.adafruit.com/assets/assets/000/115/148/medium800/manufacturing_pinguin-eagle-before-after.png?1663526856)

Because the text elements have been rasterized, they’re **no longer directly editable in EAGLE**. You can _move_ and _rotate_ these rasters, but to _change the text_ you’ll need to find the original item in backup layers 172 or 173, change properties to move it back to layer 21 or 22, edit the text and re-run Pinguin.

This is why Pinguin outputs to a new file. The raster text…especially from “vector” font text…isn’t a perfect match, and you may be iterating a few times to find an ideal size and appearance. _Then_&nbsp;tweak the positions in EAGLE in the output file if needed.

### **Selecting and Scaling Fonts**

A few command line options allow changing TrueType font selections and relative sizes.

`-vfont`, `-pfont` and `-ffont` select different TrueType fonts for the vector, proportional and fixed text elements. They can be set individually, or in combination. Each accepts a TrueType font filename, for example:

```terminal
python pinguin.py board.brd -vfont fonts/GNU/FreeSans.ttf
```

The default proportional and fixed fonts match what EAGLE uses for display (but not output), so it’s somewhat WYSIWYG-like in that regard. The default vector font isn’t a close match so you’ll probably want to experiment. The fonts folder contains a few items with permissive licensing, and there’s a ton more at&nbsp;[fonts.google.com](https://fonts.google.com).

`-vscale`, `-pscale` and `-fscale` adjust the size of the rasterized vector, proportional or fixed text. Each accepts a floating-point value,&nbsp;empirically derived, larger value = larger font. For example:

```terminal
python pinguin.py board.brd -vscale 1.33
```

Default scales for vector, proportional and fixed fonts are around 1.33, 1.41 and 1.41, respectively. Combined with the default fonts, these are a near perfect match for proportional and fixed text elements (vector, not so much).

### **Other Settings, and Limitations**

Pinguin’s raster resolution can be configured with the `-dpi` setting:

```terminal
python pinguin.py board.brd -dpi 600
```

Default is 1200 dots per inch, which is probably excessive, but no harm done. Too much is better than too little, especially with text at an angle. You can try lower values if concerned about output file sizes.

 **MULTI-LINE TEXT**

EAGLE allows entering multi-line text, but Pinguin might not render this with the same line spacing, or might get the vertical position slightly wrong. A workaround for now is to enter each line as a separate text object.

**NO INVERSE**

Pinguin only generates “positives” — the text is whatever your silk color is. If you need inverse (e.g. black text inside a white box), [SparkFun’s _Buzzard_](https://www.sparkfun.com/news/3904) has you covered!

**REALITY LOOKS BETTER THAN EAGLE**

Something about the way EAGLE renders these raster objects makes them look grainy on-screen. Pinguin’s (and Buzzard’s) rasters are actually pretty sharp, and you’ll see this in a Gerber viewer app.

![](https://cdn-learn.adafruit.com/assets/assets/000/115/154/medium800/manufacturing_font-samples.png?1663538131)

# Adafruit Pinguin for EAGLE CAD

## Inserting Logos/Symbols

Not just for text! If you have certain silkscreen graphics that you tend to use again and again — logos or other design elements — Pinguin can drop these in over placeholder rectangles.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/835/medium800/manufacturing_pinguin-logo-banner.png?1683223342)

Principle is similar to text. Place **rectangle** objects in the **tPlace (21)** or **bPlace (22)** layers and run the board file through Pinguin. But first…

Associate an **image filename** with a rectangle by setting the object’s **group** property.

You can do this by right-clicking over a rectangle and selecting “ **New Group** ” from the pop-up menu, then entering an **image filename** (located in Pinguin’s **“symbols” sub-folder** ). Or you can **change** the image (group) via the **Properties** dialog.

![manufacturing_pinguin-rect-group-1.png](https://cdn-learn.adafruit.com/assets/assets/000/120/836/medium640/manufacturing_pinguin-rect-group-1.png?1683223355)

![manufacturing_pinguin-rect-group-2.png](https://cdn-learn.adafruit.com/assets/assets/000/120/837/medium640/manufacturing_pinguin-rect-group-2.png?1683223367)

![manufacturing_pinguin-rect-group-3.png](https://cdn-learn.adafruit.com/assets/assets/000/120/838/medium640/manufacturing_pinguin-rect-group-3.png?1683223378)

The group thing is admittedly weird and clunky but it’s the only place we found to easily attach this extra information to a rectangle.

Images can be in **BMP** or **PNG** format. BMP is ancient but long-time EAGLE users might already have a lot of silkscreen elements in that format (it’s what the old school _import-bmp.ulp_ script uses; how we did this before Pinguin).

Pinguin will observe a rectangle’s **rotation** setting when placing images. For example, if you need a logo rotated 90 degrees, set the rectangle’s **angle** property. You’ll get no visual feedback in EAGLE (it still looks like a rectangle), but you’ll notice the difference when running it through the Pinguin script. This might require a couple tries to get right. _As with text, the original rectangles are saved in layers 172–173 if you need them back._

Unlike text which is always rasterized at 1200 dots per inch (or whatever `-dpi` setting was specified), images don’t observe a hard number here; the source bitmap is **scaled** to the rectangle’s dimensions (letterboxing or pillarboxing as necessary to keep image pixels square, see below), **whatever that works out to be**.

Let’s suppose one has a logo they anticipate using at various sizes from 1/2 to 1 inch wide. You _could_ produce two different images, one for each size, at 1200 DPI (or your preferred working resolution). These would then be 600 and 1200 pixels wide. But it’s likely _sufficient_ to _split the difference_ and make a _single image…_900 pixels in this case…which works out to 1800 DPI at the 1/2 inch size and 900 DPI at the 1 inch size. Both are more than ample and won’t appear jaggy on the finished board; the actual silkscreen resolution will be something less than that.

![](https://cdn-learn.adafruit.com/assets/assets/000/120/839/medium800/manufacturing_pinguin-letterbox-pillarbox.png?1683223398)

As explained on the “Using” page, EAGLE’s bitmap rendering makes things appear more rough than the finished product. Try using a Gerber PCB viewer for a better preview of the finished product!


## Related Guides

- [CircuitPython Libraries with the Binho Nova Multi-Protocol USB Host Adapter](https://learn.adafruit.com/circuitpython-with-binho-nova-multi-protocol-usb-host-adapter.md)
- [Machine Learning 101 with Lobe and BrainCraft](https://learn.adafruit.com/machine-learning-101-lobe-braincraft.md)
- [SMT Manufacturing](https://learn.adafruit.com/smt-manufacturing.md)
- [Adafruit 2.7" eInk Display Breakouts and Shields](https://learn.adafruit.com/adafruit-2-7-eink-display-breakouts-and-shields.md)
- [DIY 3D Printing Filament](https://learn.adafruit.com/diy-3d-printing-filament.md)
- [Matrix Keypad](https://learn.adafruit.com/matrix-keypad.md)
- [CircuitPython Libraries on any Computer with FT232H](https://learn.adafruit.com/circuitpython-on-any-computer-with-ft232h.md)
- [Make your own PCB with Eagle, OSH Park, and Adafruit!](https://learn.adafruit.com/making-pcbs-with-oshpark-and-eagle.md)
- [Currying in CircuitPython](https://learn.adafruit.com/partials-in-circuitpython.md)
- [OpenClaw on Raspberry Pi](https://learn.adafruit.com/openclaw-on-raspberry-pi.md)
- [Moonshine Voice Control on Raspberry Pi](https://learn.adafruit.com/moonshine-voice-control-on-raspberry-pi.md)
- [UTi165 Thermal Fever Scanner Camera](https://learn.adafruit.com/uti165-thermal-fever-scanner-camera.md)
- [Automatic Naughty Cat Detector using Lobe](https://learn.adafruit.com/naughty-cat-detector-using-microsoft-lobe.md)
- [Adding a Single Board Computer to PlatformDetect for Blinka](https://learn.adafruit.com/adding-a-single-board-computer-to-platformdetect-for-blinka.md)
- [eInk Slow Movie Player](https://learn.adafruit.com/eink-slow-movie-player.md)
