unicodedrawing

Drawing "ascii" (text) schematics with unicode characters


I'm trying to draw electronic schematics with text. I used to do this with ascii-only letters, but wanted to have something more fancy. Here is an example in ascii:

  VDD -------------*---------*-----*-----------------*-----*---------*-------                                                                   
                   |         |     |                 |     |         |    
                   |         |     |                 |     |         |     
               |---|     |---|     |---|         |---|     |---|     |---|        
    vclk o----o|--------o|             |o--   --o|             |o--------|o----o vclk             
               |---|     |---|     |---|   \ /   |---|     |---|     |---|     
                   |         |     |        x        |     |         |    
                   |         |-----*-------* *-------*-----|         |                             
                   |               |        x        |               |    
                   |               |---|   / \   |---|               |    
                   |                   |---   ---|                   |          
                   |               |---|         |---|               |    
                   |               |                 |               |     
                   |---------------*                 *---------------|                    
                                   |                 |     
                               |---|                 |---|                
                    vinp o-----|                         |o----o vinn         
                               |---|                 |---|                
                                   |--------*--------|    
                                            |    
                                            |    
                                        |---|    
                              vclk o----|        
                                        |---|    
                                            |    
                                            |    
  VSS --------------------------------------*--------------------------------- 

which I now changed to

  VDD ─────────────┬─────────┬─────┬─────────────────┬─────┬─────────┐                                                                          
                   │         │     │                 │     │         │    
                   │         │     │                 │     │         │     
               ║───┘     ║───┘     └───║         ║───┘     └───║     └───║        
    vclk o────o║────────o║             ║o──   ──o║             ║o────────║o────o vclk             
               ║───┐     ║───┐     ┌───║   ╲ ╱   ║───┐     ┌───║     ┌───║     
                   │         │     │        ╳        │     │         │    
                   │         └─────┼──────── ────────┼─────┘         │                             
                   │               │        ╳        │               │    
                   │               └───║   ╱ ╲   ║───┘               │    
                   │                   ║───   ───║                   │          
                   │               ┌───║         ║───┐               │    
                   │               │                 │               │     
                   └───────────────┤                 ├───────────────┘                    
                                   │                 │     
                               ║───┘                 └───║                
                    vinp o─────║                         ║o────o vinn         
                               ║───┐                 ┌───║                
                                   └────────┬────────┘    
                                            │    
                                            │    
                                        ║───┘    
                              vclk o────║        
                                        ║───┐    
                                            │    
                                            │    
  VSS ─────────────────────────────────────────────────────────────────

I'm quite happy with the result, but the newer drawing is missing some important things:

  1. Is it possible to get little dots ON the wires where wires cross, similar to the asterisks that I used in the ascii schematic? I tried a few combining characters but nothing looked right.
  2. Is there a possibility to connect the diagonal lines to the straight ones? From what I found online these characters don't exist, but maybe I'm wrong or there is another way.

To be precise, the two questions are (for example) about these parts:

       here
└────────┬────────┘    
         │ 

and

──   ──
  ╲ ╱  
   ╳   
─── ───
   ╳   
  ╱ ╲  
──   ──
     ^
    here

Solution

  • I wound up here while searching for basically anything about drawing circuit diagrams with unicode, and sadly there doesn't seem to be much of it out there. Which is a real shame, because unicode is really only missing a few characters that would make this work quite well.

    Poking around the unicode tables for options, angle brackets look viable for the sideways-Y intersections:

    ──   ──
      ╲ ╱  
       ╳   
    ──❬ ❭──
       ╳   
      ╱ ╲  
    ──   ──
    

    But transitioning from diagonal to orthogonal otherwise doesn't seem to have any clean answers. IMHO it's probably best to stick with right angles.

    As for junctions, I think maybe using the heavy versions of the box drawings characters might work:

    └────────┳────────┘
             │
    

    Maybe even in combination with the split-thickness lines:

    └───────╼┳╾───────┘
             ╿
    

    I think that's the best I can offer. Hope it helps you or anyone else who comes along looking for the same thing.