add EX mode, script name display
s-ol
3 years ago
Binary diff not shown
0 | Copyright (c) 2013-2017, Jany Belluz (jany.belluz@hotmail.fr) | |
1 | ||
2 | This Font Software is licensed under the SIL Open Font License, Version 1.1. | |
3 | This license is copied below, and is also available with a FAQ at: | |
4 | http://scripts.sil.org/OFL | |
5 | ||
6 | ||
7 | ----------------------------------------------------------- | |
8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 | |
9 | ----------------------------------------------------------- | |
10 | ||
11 | PREAMBLE | |
12 | The goals of the Open Font License (OFL) are to stimulate worldwide | |
13 | development of collaborative font projects, to support the font creation | |
14 | efforts of academic and linguistic communities, and to provide a free and | |
15 | open framework in which fonts may be shared and improved in partnership | |
16 | with others. | |
17 | ||
18 | The OFL allows the licensed fonts to be used, studied, modified and | |
19 | redistributed freely as long as they are not sold by themselves. The | |
20 | fonts, including any derivative works, can be bundled, embedded, | |
21 | redistributed and/or sold with any software provided that any reserved | |
22 | names are not used by derivative works. The fonts and derivatives, | |
23 | however, cannot be released under any other type of license. The | |
24 | requirement for fonts to remain under this license does not apply | |
25 | to any document created using the fonts or their derivatives. | |
26 | ||
27 | DEFINITIONS | |
28 | "Font Software" refers to the set of files released by the Copyright | |
29 | Holder(s) under this license and clearly marked as such. This may | |
30 | include source files, build scripts and documentation. | |
31 | ||
32 | "Reserved Font Name" refers to any names specified as such after the | |
33 | copyright statement(s). | |
34 | ||
35 | "Original Version" refers to the collection of Font Software components as | |
36 | distributed by the Copyright Holder(s). | |
37 | ||
38 | "Modified Version" refers to any derivative made by adding to, deleting, | |
39 | or substituting -- in part or in whole -- any of the components of the | |
40 | Original Version, by changing formats or by porting the Font Software to a | |
41 | new environment. | |
42 | ||
43 | "Author" refers to any designer, engineer, programmer, technical | |
44 | writer or other person who contributed to the Font Software. | |
45 | ||
46 | PERMISSION & CONDITIONS | |
47 | Permission is hereby granted, free of charge, to any person obtaining | |
48 | a copy of the Font Software, to use, study, copy, merge, embed, modify, | |
49 | redistribute, and sell modified and unmodified copies of the Font | |
50 | Software, subject to the following conditions: | |
51 | ||
52 | 1) Neither the Font Software nor any of its individual components, | |
53 | in Original or Modified Versions, may be sold by itself. | |
54 | ||
55 | 2) Original or Modified Versions of the Font Software may be bundled, | |
56 | redistributed and/or sold with any software, provided that each copy | |
57 | contains the above copyright notice and this license. These can be | |
58 | included either as stand-alone text files, human-readable headers or | |
59 | in the appropriate machine-readable metadata fields within text or | |
60 | binary files as long as those fields can be easily viewed by the user. | |
61 | ||
62 | 3) No Modified Version of the Font Software may use the Reserved Font | |
63 | Name(s) unless explicit written permission is granted by the corresponding | |
64 | Copyright Holder. This restriction only applies to the primary font name as | |
65 | presented to the users. | |
66 | ||
67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font | |
68 | Software shall not be used to promote, endorse or advertise any | |
69 | Modified Version, except to acknowledge the contribution(s) of the | |
70 | Copyright Holder(s) and the Author(s) or with their explicit written | |
71 | permission. | |
72 | ||
73 | 5) The Font Software, modified or unmodified, in part or in whole, | |
74 | must be distributed entirely under this license, and must not be | |
75 | distributed under any other license. The requirement for fonts to | |
76 | remain under this license does not apply to any document created | |
77 | using the Font Software. | |
78 | ||
79 | TERMINATION | |
80 | This license becomes null and void if any of the above conditions are | |
81 | not met. | |
82 | ||
83 | DISCLAIMER | |
84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | |
86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | |
87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE | |
88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | |
90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | |
92 | OTHER DEALINGS IN THE FONT SOFTWARE. |
0 | Fantasque Sans Mono | |
1 | =================== | |
2 | ||
3 | A programming font, designed with functionality in mind, and with some | |
4 | wibbly-wobbly handwriting-like fuzziness that makes it unassumingly cool. | |
5 | [Download](https://github.com/belluzj/fantasque-sans/releases/latest) or | |
6 | see [installation instructions](#installation). | |
7 | ||
8 | ||
9 |  | |
10 | ||
11 | Previously known as *Cosmic Sans Neue Mono*. It | |
12 | appeared that [similar names were already in use for other | |
13 | fonts](https://github.com/belluzj/cosmic-sans-neue/issues/16), and that | |
14 | people tended to extend their instinctive hatred of Comic Sans to this very | |
15 | font of mine (which of course can only be *loved*). Why the previous name? | |
16 | Here is my original explanation: | |
17 | ||
18 | > The name comes from my realization that at some point it looked like the | |
19 | > mutant child of Comic Sans and Helvetica Neue. Hopefully it is not the | |
20 | > case any more. | |
21 | ||
22 | Inspirational sources include Inconsolata and Monaco. I have also been using | |
23 | Consolas a lot in my programming life, so it may have some points in common. | |
24 | ||
25 |  | |
26 |  | |
27 | ||
28 | Weights, variants and glyph coverage | |
29 | ------------------------------------ | |
30 | ||
31 | The font includes a bold version, with the same metrics as the regular one. | |
32 | Both versions include the same ranges of characters : latin letters, some | |
33 | accented glyphs (quite a lot), some greek letters, some arrows. | |
34 | ||
35 | Please note that I have not tested all of the glyphs I have drawn (some letters | |
36 | have those two layers of crazy accents that I have never witnessed before), so | |
37 | it might look bad in some cases. Please report these problems: see next section. | |
38 | ||
39 | It also features a good italic version, which I designed in a fashion similar | |
40 | to Consolas' italic version, with new glyph designs, not just an added slant. | |
41 | ||
42 |  | |
43 | ||
44 | Stylistic set(s) | |
45 | ---------------- | |
46 | ||
47 | ### `ss01`: nondescript `k` | |
48 | ||
49 | No ~~distractive~~ lovely loop. | |
50 | [Get the pre-activated version here](https://github.com/belluzj/fantasque-sans/releases/download/1.8.0/FantasqueSansMono-NoLoopK.zip) | |
51 | or see the [issue #67](https://github.com/belluzj/fantasque-sans/issues/67) | |
52 | for techniques to activate the stylistic set. | |
53 | ||
54 |  | |
55 | ||
56 | Author and license | |
57 | ------------------ | |
58 | ||
59 | Created by Jany Belluz \<jany.belluz AT hotmail.fr\> | |
60 | ||
61 | Licensed under the SIL Open Font License (see [LICENSE.txt](LICENSE.txt)). | |
62 | ||
63 | Please send me an e-mail or [report an issue on | |
64 | Github](http://github.com/belluzj/cosmic-sans-neue/issues) if you stumble upon | |
65 | bad design or rendering problems (with screen shot if possible), or if you need | |
66 | more characters, or if you want to compliment me (I love compliments). | |
67 | ||
68 | Installation | |
69 | ------------ | |
70 | ||
71 | You can [download the latest version](https://github.com/belluzj/fantasque-sans/releases/latest) | |
72 | and install it by hand. In the `NoLoopK` variant, the looped lowercase `k` is | |
73 | replaced with a straight version. The `LargeLineHeight` variant is especially | |
74 | useful for users of accented capitals. For more info, see the [CHANGELOG](CHANGELOG.md). | |
75 | ||
76 | Automatic installation on macOS with [homebrew](https://brew.sh): | |
77 | ||
78 | brew tap homebrew/cask-fonts #You only need to do this once for cask-fonts | |
79 | brew cask install font-fantasque-sans-mono | |
80 | ||
81 | Instructions for other platforms might follow. | |
82 | ||
83 | Building installable font files | |
84 | ------------------------------- | |
85 | ||
86 | The build process requires: | |
87 | * FontForge with python scripting support, | |
88 | * `ttfautohint` | |
89 | * `sfnt2woff` (from the `woff-tools` package on Ubuntu) | |
90 | * `woff2_compress` from [the Google WOFF2 | |
91 | tools](https://github.com/google/woff2) or `woff2` package on Ubuntu | |
92 | ||
93 | Run `make`. You should see green stuff and some "OK" messages. | |
94 | ||
95 | If you are using Ubuntu, please note that the FontForge version | |
96 | in the default Ubuntu repositories is much outdated at the time of this writing, | |
97 | and that [is known to have caused subtle problems](https://github.com/belluzj/fantasque-sans/issues/59). | |
98 | You are advised to install FontForge from | |
99 | [this PPA](https://launchpad.net/~fontforge/+archive/ubuntu/fontforge) | |
100 | (using `sudo add-apt-repository ppa:fontforge/fontforge` prior to the installation). | |
101 | Alternatively, you can always [download](https://github.com/belluzj/fantasque-sans/releases/latest) | |
102 | the latest prebuilt release of these fonts. | |
103 | ||
104 | `make install` will install the TTF fonts into your local `.fonts/` directory | |
105 | and update the font cache. It comes in handy while modifying the font. | |
106 | ||
107 | [](Specimen/Specimen.pdf) | |
108 | ||
109 | Webfonts | |
110 | -------- | |
111 | ||
112 | Each variant has a `Webfonts/` folder which contains various font formats for | |
113 | use on the web, along with the matching CSS font declarations. To use them, | |
114 | you must combine in the same folder: | |
115 | * a custom `.css` file that you can assemble from the `*-decl.css` fragments | |
116 | (you can only pick the styles that you need, e.g. normal and bold) | |
117 | * the matching `.svg`, `.woff`, `.woff2` files from `Webfonts/` | |
118 | * the matching `.ttf` files from the `TTF/` folder | |
119 | * the matching `.otf` files from the `OTF/` folder. | |
120 | ||
121 | Versions | |
122 | -------- | |
123 | ||
124 | [Check out the changelog](CHANGELOG.md). |
7 | 7 | for k, v in pairs require 'api' |
8 | 8 | _G[k] = v |
9 | 9 | |
10 | scriptfile = arg[#arg] | |
11 | scriptfile = nil if scriptfile == '.' | |
12 | ||
10 | 13 | COMMIT = false |
11 | 14 | INPUT = Input! |
12 | 15 | STATE = State! |
13 | SESSION = Session Script arg[#arg] | |
16 | SESSION = Session scriptfile | |
14 | 17 | |
15 | 18 | love.draw = -> |
16 | 19 | p = INPUT\key_down 'p' |
23 | 26 | profile.stop! |
24 | 27 | print love.timer.getFPS! |
25 | 28 | print profile.report 20 |
29 | ||
26 | 30 | love.keypressed = INPUT\keypressed |
27 | 31 | love.keyreleased = INPUT\keyreleased |
32 | love.textinput = INPUT\textinput | |
28 | 33 | love.mousemoved = INPUT\mousemoved |
29 | 34 | love.mousepressed = INPUT\mousepressed |
30 | 35 | love.mousereleased = INPUT\mousereleased |
0 | 0 | lfs = require 'lfs' |
1 | utf8 = require 'utf8' | |
1 | 2 | moon = require 'moonscript.base' |
2 | 3 | |
4 | { graphics: lg } = love | |
3 | 5 | trace = (msg) -> debug.traceback msg, 2 |
4 | 6 | |
5 | 7 | class Script |
64 | 66 | import Object from require 'object' |
65 | 67 | |
66 | 68 | class Session |
67 | new: (@script) => | |
69 | FONTSIZE = 20 | |
70 | new: (scriptfile) => | |
68 | 71 | @objects = {} |
69 | 72 | for i=1,4 |
70 | table.insert @objects, Object nil, random.size!/8 | |
73 | ||
74 | -- table.insert @objects, Object nil, random.size!/8 | |
75 | ||
76 | if scriptfile | |
77 | @script = Script scriptfile | |
78 | ||
79 | @font = lg.newFont 'font/FantasqueSansMono-Regular.ttf', 20 | |
80 | @ex = false | |
81 | ||
82 | exec: (command) => | |
83 | switch command\match '^(%w+)' | |
84 | when 'quit' | |
85 | love.event.quit! | |
86 | when 'run' | |
87 | @script = Script command\match '^run%s+(.+)' | |
71 | 88 | |
72 | 89 | frame: => |
73 | 90 | for obj in *@objects |
76 | 93 | if INPUT\key_down 'escape' |
77 | 94 | STATE\reset! |
78 | 95 | |
79 | @script\reload_and_run! | |
96 | w,h = lg.getDimensions! | |
97 | lg.setFont @font | |
80 | 98 | |
81 | if INPUT\key_down 'space' | |
82 | @script\commit! | |
83 | STATE\reset! | |
99 | if @script | |
100 | @script\reload_and_run! | |
84 | 101 | |
102 | if INPUT\key_down 'space' | |
103 | @script\commit! | |
104 | STATE\reset! | |
105 | ||
106 | lg.print "script: #{@script.file}", 10, 10 | |
107 | ||
108 | if (INPUT\key_down ':') or (INPUT\key_down ';') and INPUT\key_held 'lshift' | |
109 | INPUT\text_capture! | |
110 | @ex = true | |
111 | ||
112 | if @ex | |
113 | lg.print ":#{INPUT.text}", 10, h - 10 - FONTSIZE | |
114 | ||
115 | apply = INPUT\key_down 'return' | |
116 | input = if apply or INPUT\key_down 'escape' | |
117 | @ex = nil | |
118 | apply and @exec INPUT\text_release! | |
119 | ||
120 | @exec input if input | |
85 | 121 | |
86 | 122 | { |
87 | 123 | :Script |