Update README.md
[proportionaltomonofont] / README.md
1 # This project is a fork of dtinth/comic-mono-font
2
3 That project was to create a font. This project is designed to use the generate.py script and use it to take a proportional spaced font and make it a mono spaced font.
4
5 This may be a very silly idea.  I have got the script to work to generate a mono spaced font from a proportional font.  The key is tweaking the height and width so the fonts look nice.
6
7 ## Dependencies
8
9 Python 2
10
11 The python bindings for font forge
12
13 This link may help you install the bindings
14
15 [https://stackoverflow.com/questions/36508944/install-fontcustom-fontforge-in-ubuntu](https://stackoverflow.com/questions/36508944/install-fontcustom-fontforge-in-ubuntu)
16
17 ## How to use the script
18
19 Install the Dependencies
20 Put the proportional font you are going to convert in the vendor directory
21 Put the reference font you are going to use in the vendor directory
22 Edit the script.  See bellow
23 Make the script executable 
24 Run ./generate.py 
25 Your normal font and bold font will be generated and should be found in the same directory as generate.py
26 The fonts can now be installed.  
27 Depending on the width and height you set will affect what the font actually looks like.  It could look nice or it could look awful.
28
29 ## You need to edit the script.  Here is the list of things you need to change:
30
31 ### Change the following two lines to the script to the font you are going to convert and the reference font
32 font = fontforge.open('vendor/comic-shanns.otf')
33 ref = fontforge.open('vendor/Cousine-Regular.ttf')
34
35 ### Change the integer value the larger the number the wider the font
36 target_width = 510
37
38 #### change number in adjust_height to make font shorter or taller
39 adjust_height(font, ref, 0.875)
40
41 ### change to desired font name
42 font.fontname = 'ComicMono'
43 ### change to desired full name
44 font.fullname = 'Comic Mono'
45 #change to desired file name
46 font.generate('ComicMono.ttf')
47
48 ### Bold section
49 ### change to desired font name
50 font.fontname = 'ComicMono-Bold'
51
52 ### change to desired full name
53 font.fullname = 'Comic Mono Bold'
54
55 ### change to desired file name
56 font.generate('ComicMono-Bold.ttf')
57
58 ## Notes:
59 What is the reference font for?
60 Taken from Comic Mono font README.md
61 The glyph metrics have been adjusted to make it display better alongside system font, based on Cousine’s metrics.
62 You could use a different font as the reference as see how it changes the font.
63
64 ## License
65 It is licensed under the [MIT License](LICENSE).