17

All fonts I have ever heard of are two dimensional: each glyph is basically a two dimensional region (a closed contour or some closed contours), which the software or printer somehow strokes or fills depending on the instructions given by the user. I would like to know whether there are one dimensional fonts, where the glyphs are described just as collections of segments (which the software can stroke but not necessarily fill), not of regions.

In other word (or better, in images), what I would like to have is the left thing instead of the right one in the picture below. Does this exist?

From a two dimensional to a one dimensional letter

(sorry for the picture, I know it is really bad; I just did that quickly)

  • Perhaps we need to answer graphicdesign.stackexchange.com/questions/64626/… before we can really answer your question – Ryan Dec 23 '15 at 1:57
  • What is your desired application for the font? I can't see any use in a single stroke font for designing so I'm assuming you are wanting this for a blueprint or engraving. What program are you intending to use the font on? – DavidC Dec 23 '15 at 2:46
  • 5
    There's still two dimensions, there is just no inside :P – Zach Saucier Dec 23 '15 at 2:51
  • 8
    The closest thing to a one dimensional font would be a barcode. – Gerald Schneider Dec 23 '15 at 9:15
  • Just as an idea of an application, I wrote a Raspberry Pi demo to plot paths of an SVG on an XY oscilloscope -- this would have been perfect for that. Admittedly this is an unusual medium (as is the pen-plotter I intend to use it on later). – Chris H Dec 23 '15 at 9:43
23

In plotters, it's called a "stroke font", "single line font", "engraving font", "technical lettering font", or just "plotter font".

A plotter strokes images onto paper using a pen. It cannot fill images except by repeatedly stroking them less than a pen-width apart. So fonts designed for use with plotters will contain glyphs with one stroke ("simplex"), two more or less parallel strokes ("duplex"), or three strokes ("triplex"). Fonts with more strokes take longer to draw but allow more variation in stroke width within a glyph. Using a pen too narrow for a glyph at a given size will cause visible gaps between the strokes.

One example of a mostly simplex font is Hershey Vector Font. Its at sign @, brackets [], braces {}, and tilde ~ are duplex.

Glyphs in Hershey Vector Font

If you've seen "blackboard bold", that's a 𝕕𝕦𝕡𝕝𝕖𝕩 font with the pen width less than the distance between strokes.

BOLD in a duplex serif font

Old-school imaging libraries supported stroke fonts in much the same way as a plotter does. When rendering text, an application would set the stroke width and color before drawing text, just as it does before drawing a line. This is analogous to selecting a pen on a plotter.

But modern raster imaging libraries use OpenType fonts, which contain TrueType or CFF (PostScript Type 2) outlines. OpenType fonts simulating stroke fonts instead contain the outline of a stroke at some line width. This stroking operation can be reversed by insetting the glyph's outline by a distance of half a stroke width, sort of the inverse of algorithmic bold.

  • Bingo! They do exist but are pretty useless unless used for BluePrints, engraving, or Laser applications. Design apps like Adobe, Corel, etc. Have a hard time even rendering them, so they are not much use to actually design with. – DavidC Dec 23 '15 at 2:29
  • @DavidC: On graphics platforms which can apply transforms separately to the drawing pen independently and the font, stick fonts can work nicely if one uses a very thin elliptical pen and applies a sheer transform to it (yielding a look like a caligraphic pen). Doing that seems to work better with a nearly-stick-like font than with a font that has a normal stroke width. – supercat Dec 23 '15 at 23:45
10

Most engineering applications support fonts with just lines and user supplies thickness. As do quite many engraving and milling machines. Some fonts exist though they wont work very well in modern software (if at all).

This is the problem: The font engines have regressed since we deprecated PostScript. Sorry no easy solutions. So one could have all kinds of goodies back in the day that is no longer possible on most computers. Nearly no apps do support this even if present wont even work in svg as svg font definitions got deprecated from browsers.

The problem is that theres no universal format for such fonts. And the fonts themselves will malfunction in many cases. Normal apps will treat them weird. See:

  • A other question on the topic star-trek-interior-plaques where you can find a font like this that may work on some applications.

Jongware has made a script called monoline text drawing for illustrator for example you can get it here:

It is possible to make your own fonts of this type in PostScript though using type 3 fonts (but support is no longer wide*, though illustrator could use these under some circumstances). The support in design apps is scarce though. But i actually use this all day when doing ostScript. Here's a example (font for special use only  editted for this demo):

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 200 40
%%Title: Demo type 3 font
%%Creator: Janne Ojala
%%CreationDate:  2015-12-23
%%EndComments

% set stroking characteristics
5 setlinewidth 
1 setlinecap
1 setlinejoin

% lets define the font
10 dict dup begin
  /FontType 3 def
  /FontMatrix [.01 0 0 .01 0 0] def
  /FontBBox [-2 0 52 102] def

  /Encoding 256 array def
  0 1 255 {Encoding exch /.notdef put} for 

  Encoding
    dup (L) 0 get /L put
    dup (a) 0 get /a put
        (b) 0 get /b put

  /Metrics 4 dict def
  Metrics begin
    /.notdef 30 def
    /L 65 def
    /a 65 def
    /b 55 def
  end

  /BBox 4 dict def
  BBox begin
    /.notdef [0 0 0 0] def
    /L [0 0 75 100] def
    /a [25 0 75 100] def
    /b [25 0 65 100]  def
  end

  /CharacterDefs 4 dict def
  CharacterDefs begin
    /.notdef { } def

    /L
      { newpath
        0 100 moveto
        0 0 lineto
        50 0 lineto
        stroke
      } def 
    /a
      { newpath
        25 25 25 0 360 arc 
        50 45 moveto 
        50 0 lineto
        stroke
      } def
    /b
      { newpath
        0 100  moveto
        0 0 lineto
        40 0 40 50 17.5 arct
        40 50 0 50 17.5 arct
        0 50  lineto
        stroke
      } def
    end

  /BuildChar
    { 0 begin

        /char exch def
        /fontdict exch def

        /charname fontdict /Encoding get char get def
        fontdict begin
          Metrics charname get 0
          BBox charname get aload pop
              setcachedevice

          CharacterDefs charname get exec
        end
      end
    } def
  /BuildChar load 0 3 dict put
  /UniqueID 1 def
end

/SpecialUseOnly exch definefont pop
/special /SpecialUseOnly findfont 20 scalefont def

special setfont 

10 10 moveto

%write some text
(Lab baa baa abL) show

%%EOF

To use this just put it in text file with a EPS ending and drag and drop it into illustrator or word. make sure theres no empty lines before the begin. You can edit the text by changing whats inside the parens on 3 line form end. The caveat here is I only defined the chars 'L' 'a' and 'b'.

Preview

Image 1: Preview of font program.

* So this was easily possible back in late 1980's and mid 1990's, but not today. Support has been mostly removed some adobe softs still have this.

  • 1
    Yet, even my script cannot make it work without any thickness: you still have to set 'a' thickness to the lines you draw. But, granted, you can set it to any value you like, unlike the outline fonts that have a "predefined" thickness. – usr2564301 Dec 22 '15 at 23:07
  • 2
    A side note though, Laser cutters and cnc machines and cad apps will work without line thickness as thickness for them is just a artefact of post processing. – joojaa Dec 22 '15 at 23:13
  • 2
    That's fine and dandy, but its not a font. I've checked multiple definitions of font and have yet to find any that don't include thickness/width as part of the definition. In Graphic Design, this is not Font from anything I've found. Even @Jongware and you acknowledge there must be some thickness for it to work. I'd argue (and every definition I've found agrees) that its not a font until that occurs. However, in practice this very well might be what the OP is after if they're just trying to plot points :) Might want to look at Corel Draw, I know signmakers often use it. – Ryan Dec 23 '15 at 0:54
  • 1
    It’s also still not one-dimensional, as asked in the question. But then I’d say an actual, one-dimensional font is impossible, because one dimension will limit you to a straight line in, well, one dimension. You can do l and i without two dimensions, but not much else. – Janus Bahs Jacquet Dec 23 '15 at 0:58
  • 3
    @Ryan: fine and dandy it may be, but the bottom line is that stroke-only fonts may exist but are not supported by the current mainstream font technologies. – usr2564301 Dec 23 '15 at 7:36
8

Metafont is a description language used to define vector fonts.

Unlike more common outline font formats (such as TrueType or PostScript Type 1), a Metafont font is primarily made up of strokes with finite-width "pens", along with filled regions. Thus, rather than describing the outline of the glyph directly, a Metafont file describes the pen paths.

What you describe could be implemented as a Metafont font with a constant pen width.

6

Another term for what you're looking for is a "stick font" - there's a free set of 9 of them that I've used for CNC and laser engraving at http://www.mrrace.com/CamBam_Fonts/

Note that these fonts tend to look bad onscreen, with enclosed areas often appearing solid. This is because they are technically invalid outline fonts: each character necessarily consists of one or more closed loops (since modern OSes don't support any other kind of font), but each loop has zero area. They may therefore be unsuitable for you if the goal is something other than engraving.

  • It works ok with Inkscape provided that you stroke it instead of filling it. Thanks! – Giovanni Mascellani Feb 22 '16 at 13:04
3

In architecture a beginner might draw walls as single lines. This is inaccurate though and cannot exist - walls even thin ones have a thickness.

Likewise, your A on the left, even a thin one has a thickness. How thick? Is it 1pt? Is it 0.025pt? How does the Printer know? We must tell it.

To answer your question, no there cannot exist a one dimensional font as you describe it. All lines must have some thickness in order to exist.

  • 2
    I do not completely agree: the purpose of a font is to describe geometries related to rendering text. How these geometries have to be rendered is a different issue, which is not described by the font itself. Even with ordinary fonts described in TrueType, OpenType or what you want, you still have to decide which color, pattern and whatever to use for filling or contour stroking. So you can have a font like the one I say: it is the user's duty to specify the thickness of the line and the other properties. – Giovanni Mascellani Dec 22 '15 at 21:35
  • 2
    Moreover, there are application in which you have the concept of a line independently from its thickness. For example, the application I have in mind is vector laser engraving. The thickness of what I engrave is a byproduct of the laser speed, power and the physical properties of the material I am using. It does not need to be known by the software driving the engraver. – Giovanni Mascellani Dec 22 '15 at 21:37
  • 2
    @Ryan this is strictly not true. Its just true in a adobe centric world. And only if you want to be happy with yourself. Otherwise even then its a lie. – joojaa Dec 22 '15 at 22:53
  • 1
    @immibis that certainly does get considered in print when picking a material, ink and color but has nothing to do with the font. A font can exist on your screen free from depth, but it can't exist on your screen without some sort of width. – Ryan Dec 23 '15 at 1:23
  • 3
    All text must have line width when drawn, but this width need not be stored in the font. It can instead be stored in the document using the font, much as size and color are. – Damian Yerrick Dec 23 '15 at 1:48

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.