glotlib2 0.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. glotlib2/__init__.py +6 -0
  2. glotlib2/colors.py +44 -0
  3. glotlib2/constants.py +106 -0
  4. glotlib2/event_queue.py +28 -0
  5. glotlib2/faces.py +7 -0
  6. glotlib2/font.py +233 -0
  7. glotlib2/font_files/__init__.py +0 -0
  8. glotlib2/font_files/ttf_bitstream_vera_1_10/COPYRIGHT.TXT +124 -0
  9. glotlib2/font_files/ttf_bitstream_vera_1_10/README.TXT +11 -0
  10. glotlib2/font_files/ttf_bitstream_vera_1_10/RELEASENOTES.TXT +162 -0
  11. glotlib2/font_files/ttf_bitstream_vera_1_10/Vera.ttf +0 -0
  12. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraBI.ttf +0 -0
  13. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraBd.ttf +0 -0
  14. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraIt.ttf +0 -0
  15. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraMoBI.ttf +0 -0
  16. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraMoBd.ttf +0 -0
  17. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraMoIt.ttf +0 -0
  18. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraMono.ttf +0 -0
  19. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraSe.ttf +0 -0
  20. glotlib2/font_files/ttf_bitstream_vera_1_10/VeraSeBd.ttf +0 -0
  21. glotlib2/font_files/ttf_bitstream_vera_1_10/local.conf +32 -0
  22. glotlib2/gl_context.py +342 -0
  23. glotlib2/gl_object.py +89 -0
  24. glotlib2/glfw/__init__.py +9 -0
  25. glotlib2/glfw/backend.py +43 -0
  26. glotlib2/glfw/gl_context.py +27 -0
  27. glotlib2/glfw/window.py +281 -0
  28. glotlib2/hline.py +99 -0
  29. glotlib2/label.py +160 -0
  30. glotlib2/matrix.py +72 -0
  31. glotlib2/miter_lines.py +113 -0
  32. glotlib2/periodic.py +27 -0
  33. glotlib2/plot.py +674 -0
  34. glotlib2/program.py +67 -0
  35. glotlib2/programs.py +117 -0
  36. glotlib2/pyside6/__init__.py +13 -0
  37. glotlib2/pyside6/backend.py +25 -0
  38. glotlib2/pyside6/gl_context.py +20 -0
  39. glotlib2/pyside6/gl_widget.py +362 -0
  40. glotlib2/pyside6/window.py +25 -0
  41. glotlib2/series.py +175 -0
  42. glotlib2/shaders/__init__.py +0 -0
  43. glotlib2/shaders/frag.frag +10 -0
  44. glotlib2/shaders/miter_line.vert +49 -0
  45. glotlib2/shaders/mvp_z.vert +10 -0
  46. glotlib2/shaders/points.frag +14 -0
  47. glotlib2/shaders/rect.vert +19 -0
  48. glotlib2/shaders/square_instanced_line.vert +38 -0
  49. glotlib2/shaders/text.frag +14 -0
  50. glotlib2/shaders/text.vert +15 -0
  51. glotlib2/step_series.py +76 -0
  52. glotlib2/ticker.py +78 -0
  53. glotlib2/vbo.py +128 -0
  54. glotlib2/vline.py +99 -0
  55. glotlib2/vstrip.py +86 -0
  56. glotlib2-0.9.0.dist-info/METADATA +73 -0
  57. glotlib2-0.9.0.dist-info/RECORD +60 -0
  58. glotlib2-0.9.0.dist-info/WHEEL +5 -0
  59. glotlib2-0.9.0.dist-info/licenses/LICENSE +373 -0
  60. glotlib2-0.9.0.dist-info/top_level.txt +1 -0
glotlib2/__init__.py ADDED
@@ -0,0 +1,6 @@
1
+ from .gl_context import GLContextDelegate
2
+
3
+
4
+ __all__ = [
5
+ 'GLContextDelegate',
6
+ ]
glotlib2/colors.py ADDED
@@ -0,0 +1,44 @@
1
+ tab10 = [
2
+ (0x1F / 0xFF, 0x77 / 0xFF, 0xB4 / 0xFF, 1),
3
+ (0xFF / 0xFF, 0x7F / 0xFF, 0x0E / 0xFF, 1),
4
+ (0x2C / 0xFF, 0xA0 / 0xFF, 0x2C / 0xFF, 1),
5
+ (0xD6 / 0xFF, 0x27 / 0xFF, 0x28 / 0xFF, 1),
6
+ (0x94 / 0xFF, 0x67 / 0xFF, 0xBD / 0xFF, 1),
7
+ (0x8C / 0xFF, 0x56 / 0xFF, 0x4B / 0xFF, 1),
8
+ (0xE3 / 0xFF, 0x77 / 0xFF, 0xC2 / 0xFF, 1),
9
+ (0x7F / 0xFF, 0x7F / 0xFF, 0x7F / 0xFF, 1),
10
+ (0xBC / 0xFF, 0xBD / 0xFF, 0x22 / 0xFF, 1),
11
+ (0x17 / 0xFF, 0xBE / 0xFF, 0xCF / 0xFF, 1),
12
+ ]
13
+
14
+ named_colors = {
15
+ 'red' : (1, 0, 0, 1),
16
+ 'green' : (0, 1, 0, 1),
17
+ 'blue' : (0, 0, 1, 1),
18
+ 'black' : (0, 0, 0, 1),
19
+ 'white' : (1, 1, 1, 1),
20
+ }
21
+
22
+
23
+ def cycle(iterable):
24
+ while iterable:
25
+ yield from iterable
26
+
27
+
28
+ def make(v, none_iter):
29
+ if v is None:
30
+ return next(none_iter)
31
+ if isinstance(v, tuple):
32
+ if len(v) == 4:
33
+ return v
34
+ if len(v) == 3:
35
+ return (v[0], v[1], v[2], 1)
36
+ if isinstance(v, str):
37
+ if v.startswith('#'):
38
+ r = int(v[1:3], 16)
39
+ g = int(v[3:5], 16)
40
+ b = int(v[5:7], 16)
41
+ return (r / 0xFF, g / 0xFF, b / 0xFF, 1)
42
+ return named_colors[v]
43
+
44
+ raise Exception('Cannot convert %s to a color.' % (v,))
glotlib2/constants.py ADDED
@@ -0,0 +1,106 @@
1
+ MOUSE_BUTTON_LEFT = 0
2
+ MOUSE_BUTTON_RIGHT = 1
3
+ MOUSE_BUTTON_MIDDLE = 2
4
+
5
+ MOUSE_BUTTON_PRESS = 1
6
+ MOUSE_BUTTON_RELEASE = 2
7
+
8
+ ASPECT_NONE = 0
9
+ ASPECT_SQUARE = 1
10
+
11
+ KEY_PRESS = 1
12
+ KEY_RELEASE = 2
13
+
14
+ # Key codes used in press/release handlers. For most characters we use their
15
+ # ASCII values and they are not defined here - these are for special keys that
16
+ # don't have ASCII equivalents.
17
+ KEY_CAPS_LOCK = 256
18
+ KEY_DELETE = 257
19
+ KEY_DOWN_ARROW = 258
20
+ KEY_END = 259
21
+ KEY_ESCAPE = chr(27)
22
+ KEY_F1 = 260
23
+ KEY_F2 = 261
24
+ KEY_F3 = 262
25
+ KEY_F4 = 263
26
+ KEY_F5 = 264
27
+ KEY_F6 = 265
28
+ KEY_F7 = 266
29
+ KEY_F8 = 267
30
+ KEY_F9 = 268
31
+ KEY_F10 = 269
32
+ KEY_F11 = 270
33
+ KEY_F12 = 271
34
+ KEY_F13 = 272
35
+ KEY_F14 = 273
36
+ KEY_F15 = 274
37
+ KEY_F16 = 275
38
+ KEY_F17 = 276
39
+ KEY_F18 = 277
40
+ KEY_F19 = 278
41
+ KEY_F20 = 279
42
+ KEY_F21 = 280
43
+ KEY_F22 = 281
44
+ KEY_F23 = 282
45
+ KEY_F24 = 283
46
+ KEY_F25 = 284
47
+ KEY_HOME = 285
48
+ KEY_INSERT = 286
49
+ KEYPAD_0 = 287
50
+ KEYPAD_1 = 288
51
+ KEYPAD_2 = 289
52
+ KEYPAD_3 = 290
53
+ KEYPAD_4 = 291
54
+ KEYPAD_5 = 292
55
+ KEYPAD_6 = 293
56
+ KEYPAD_7 = 294
57
+ KEYPAD_8 = 295
58
+ KEYPAD_9 = 296
59
+ KEYPAD_PLUS = 297
60
+ KEYPAD_DOT = 298
61
+ KEYPAD_DIVIDE = 299
62
+ KEYPAD_ENTER = 300
63
+ KEYPAD_EQUALS = 301
64
+ KEYPAD_MULTIPLY = 302
65
+ KEYPAD_MINUS = 303
66
+ KEY_LEFT_ARROW = 304
67
+ KEY_LEFT_ALT = 305
68
+ KEY_LEFT_CONTROL = 306
69
+ KEY_LEFT_SHIFT = 307
70
+ KEY_LEFT_SUPER = 308
71
+ KEY_MENU = 309
72
+ KEY_NUM_LOCK = 310
73
+ KEY_PAGE_DOWN = 311
74
+ KEY_PAGE_UP = 312
75
+ KEY_PAUSE = 313
76
+ KEY_PRINT_SCREEN = 314
77
+ KEY_RIGHT_ARROW = 315
78
+ KEY_RIGHT_ALT = 316
79
+ KEY_RIGHT_CONTROL = 317
80
+ KEY_RIGHT_SHIFT = 318
81
+ KEY_RIGHT_SUPER = 319
82
+ KEY_SCROLL_LOCK = 320
83
+ KEY_UP_ARROW = 321
84
+
85
+ # Modifier bitmask used in other handlers.
86
+ MOD_LEFT_SHIFT = (1 << 0)
87
+ MOD_RIGHT_SHIFT = (1 << 1)
88
+ MOD_LEFT_ALT = (1 << 2)
89
+ MOD_RIGHT_ALT = (1 << 3)
90
+ MOD_LEFT_CONTROL = (1 << 4)
91
+ MOD_RIGHT_CONTROL = (1 << 5)
92
+ MOD_LEFT_SUPER = (1 << 6)
93
+ MOD_RIGHT_SUPER = (1 << 7)
94
+ MOD_ANY_SHIFT = MOD_LEFT_SHIFT | MOD_RIGHT_SHIFT
95
+ MOD_ANY_ALT = MOD_LEFT_ALT | MOD_RIGHT_ALT
96
+ MOD_ANY_CONTROL = MOD_LEFT_CONTROL | MOD_RIGHT_CONTROL
97
+ MOD_ANY_SUPER = MOD_LEFT_SUPER | MOD_RIGHT_SUPER
98
+
99
+ KEY_TO_MODIFIER_MAP = {
100
+ KEY_LEFT_SHIFT : MOD_LEFT_SHIFT,
101
+ KEY_RIGHT_SHIFT : MOD_RIGHT_SHIFT,
102
+ KEY_LEFT_ALT : MOD_LEFT_ALT,
103
+ KEY_RIGHT_ALT : MOD_RIGHT_ALT,
104
+ KEY_LEFT_CONTROL : MOD_LEFT_CONTROL,
105
+ KEY_RIGHT_CONTROL : MOD_RIGHT_CONTROL,
106
+ }
@@ -0,0 +1,28 @@
1
+ import threading
2
+ from collections import deque
3
+ from functools import partial
4
+
5
+
6
+ class EventQueue:
7
+ '''
8
+ Class to defer function calls to a later time.
9
+ '''
10
+ def __init__(self):
11
+ self.lock = threading.Lock()
12
+ self.queue = deque()
13
+
14
+ def enqueue(self, func, *args, **kwargs):
15
+ deferred_call = partial(func, *args, **kwargs)
16
+ with self.lock:
17
+ self.queue.append(deferred_call)
18
+
19
+ def process(self):
20
+ if not self.queue:
21
+ return
22
+
23
+ with self.lock:
24
+ local_queue = self.queue
25
+ self.queue = deque()
26
+
27
+ for deferred_call in local_queue:
28
+ deferred_call()
glotlib2/faces.py ADDED
@@ -0,0 +1,7 @@
1
+ from .font import Face
2
+
3
+
4
+ class Faces:
5
+ def __init__(self):
6
+ self.vera = Face('ttf_bitstream_vera_1_10', 'Vera.ttf')
7
+ self.vera_bold = Face('ttf_bitstream_vera_1_10', 'VeraBd.ttf')
glotlib2/font.py ADDED
@@ -0,0 +1,233 @@
1
+ import importlib.resources
2
+ import sys
3
+ import os
4
+
5
+ import numpy as np
6
+ import freetype
7
+
8
+ from OpenGL import GL
9
+
10
+
11
+ def is_pow2(v):
12
+ '''
13
+ Returns true if v is a power of 2.
14
+ '''
15
+ return (v != 0) and ((v & (v - 1)) == 0)
16
+
17
+
18
+ def ceil_pow2(v):
19
+ '''
20
+ Return v rounded up to the nearest power of 2. Returns v if it is already a
21
+ power of 2. Works for numbers up to 65536.
22
+ '''
23
+ v -= 1
24
+ v |= (v >> 1)
25
+ v |= (v >> 2)
26
+ v |= (v >> 4)
27
+ v |= (v >> 8)
28
+ return v + 1
29
+
30
+
31
+ assert ceil_pow2(1) == 1
32
+ assert ceil_pow2(2) == 2
33
+ assert ceil_pow2(3) == 4
34
+ assert ceil_pow2(4) == 4
35
+ assert ceil_pow2(5) == 8
36
+ assert ceil_pow2(10) == 16
37
+ assert ceil_pow2(123) == 128
38
+ assert ceil_pow2(2000) == 2048
39
+ assert ceil_pow2(60000) == 65536
40
+
41
+
42
+ def round_up_pow2(v, K):
43
+ '''
44
+ Round up to the nearest multiple of K, which must be a power of 2.
45
+ '''
46
+ return (v + K - 1) & ~(K - 1)
47
+
48
+
49
+ assert round_up_pow2(5, 8) == 8
50
+ assert round_up_pow2(20, 8) == 24
51
+ assert round_up_pow2(121, 32) == 128
52
+ assert round_up_pow2(2, 32) == 32
53
+
54
+
55
+ class Glyph:
56
+ def __init__(self, bm_left, bm_top, bm_width, bm_height, dx, tex_x0,
57
+ tex_y0, tex_x1, tex_y1):
58
+ self.bm_left = bm_left
59
+ self.bm_top = bm_top
60
+ self.bm_width = bm_width
61
+ self.bm_height = bm_height
62
+ self.dx = dx
63
+ self.tex_x0 = tex_x0
64
+ self.tex_y0 = tex_y1
65
+ self.tex_x1 = tex_x1
66
+ self.tex_y1 = tex_y0
67
+ self.tex_coords = [
68
+ (self.tex_x0, self.tex_y0),
69
+ (self.tex_x1, self.tex_y1),
70
+ (self.tex_x0, self.tex_y1),
71
+ (self.tex_x0, self.tex_y0),
72
+ (self.tex_x1, self.tex_y0),
73
+ (self.tex_x1, self.tex_y1),
74
+ ]
75
+
76
+
77
+ class Font:
78
+ def __init__(self, tex_data, glyphs, oversample_log2, ascender, height,
79
+ size):
80
+ self.tex_data = tex_data
81
+ self.tex_w = tex_data.shape[1]
82
+ self.tex_h = tex_data.shape[0]
83
+ self.glyphs = glyphs
84
+ self.oversample = (1 << oversample_log2)
85
+ self.ascender = ascender
86
+ self.height = height
87
+ self.size = size
88
+ self.tex = None
89
+ self.bind_unit = None
90
+
91
+ def _init_gl(self):
92
+ self.tex = GL.glGenTextures(1)
93
+
94
+ GL.glBindTexture(GL.GL_TEXTURE_2D, self.tex)
95
+ GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER,
96
+ GL.GL_NEAREST)
97
+ GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER,
98
+ GL.GL_NEAREST)
99
+ GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_R8, self.tex_w, self.tex_h,
100
+ 0, GL.GL_RED, GL.GL_UNSIGNED_BYTE, self.tex_data)
101
+
102
+ def bind(self, unit):
103
+ if self.tex is None:
104
+ self._init_gl()
105
+
106
+ GL.glActiveTexture(GL.GL_TEXTURE0 + unit)
107
+ GL.glBindTexture(GL.GL_TEXTURE_2D, self.tex)
108
+ self.bind_unit = unit
109
+
110
+ def gen_vertices_left(self, text, dy=1):
111
+ '''
112
+ Generates vertices for left-aligned text, returning a tuple:
113
+
114
+ (window vertices, texture coords, window width, window height)
115
+
116
+ For text to grow downwards, set dy = -1. For text to grow upwards, set
117
+ dy = 1.
118
+ '''
119
+ pen_x = 0
120
+ pen_y = 0
121
+ width = 0
122
+ vertices = []
123
+ tex_coords = []
124
+ for c in text:
125
+ if c == '\n':
126
+ width = max(width, pen_x)
127
+ pen_x = 0
128
+ pen_y += dy * (self.height // (64 * self.oversample))
129
+ continue
130
+
131
+ g = self.glyphs[c]
132
+ w = g.bm_width / self.oversample
133
+ h = g.bm_height / self.oversample
134
+ if w or h:
135
+ x = pen_x + g.bm_left / self.oversample
136
+ y = pen_y + g.bm_top / self.oversample - h
137
+ vertices += [(x, y),
138
+ (x + w, y + h),
139
+ (x, y + h),
140
+ (x, y),
141
+ (x + w, y),
142
+ (x + w, y + h),
143
+ ]
144
+ tex_coords += g.tex_coords
145
+
146
+ pen_x += g.dx / self.oversample
147
+
148
+ width = max(width, pen_x)
149
+ vertices = np.array(vertices, dtype=np.float32)
150
+ tex_coords = np.array(tex_coords, dtype=np.float32)
151
+
152
+ return vertices, tex_coords, width, pen_y + self.ascender
153
+
154
+
155
+ class Face:
156
+ def __init__(self, family, name):
157
+ if sys.version_info < (3, 9):
158
+ with importlib.resources.open_binary(
159
+ 'glotlib.font_files.%s' % family, name) as byte_stream:
160
+ self.face = freetype.Face(byte_stream)
161
+ else:
162
+ name = os.path.join(family, name)
163
+ files = importlib.resources.files('glotlib.font_files')
164
+ with files.joinpath(name).open('rb') as byte_stream:
165
+ self.face = freetype.Face(byte_stream)
166
+
167
+ self.sizes = {}
168
+
169
+ def __call__(self, size, oversample_log2=0):
170
+ font = self.sizes.get((size, oversample_log2))
171
+ if font is None:
172
+ font = self._load_size(size, oversample_log2)
173
+ self.sizes[(size, oversample_log2)] = font
174
+ return font
175
+
176
+ def _load_size(self, size, oversample_log2):
177
+ self.face.set_char_size(int(size * 64 * (1 << oversample_log2)))
178
+
179
+ rows = 1
180
+ x = 0
181
+ row_h = 0
182
+ tex_h = 0
183
+ asc = 0
184
+ for _, ci in self.face.get_chars():
185
+ self.face.load_glyph(ci)
186
+ g = self.face.glyph
187
+ w = g.bitmap.width
188
+ x += w
189
+ if x > 1024:
190
+ rows += 1
191
+ x = w
192
+ tex_h += row_h
193
+ row_h = 0
194
+
195
+ row_h = max(row_h, g.bitmap.rows)
196
+ asc = max(asc, g.bitmap_top / (1 << oversample_log2))
197
+
198
+ tex_h = ceil_pow2(tex_h + row_h)
199
+ tex_w = 1024 if rows > 1 else ceil_pow2(x)
200
+ tex_data = np.zeros((tex_h, tex_w), dtype=np.ubyte)
201
+
202
+ x = 0
203
+ y = 0
204
+ row_h = 0
205
+ do = oversample_log2 / 2
206
+ glyphs = {}
207
+ for cc, ci in self.face.get_chars():
208
+ c = chr(cc)
209
+ self.face.load_glyph(ci)
210
+ g = self.face.glyph
211
+
212
+ w = g.bitmap.width
213
+ if x + w >= 1024:
214
+ x = 0
215
+ y += row_h
216
+ row_h = 0
217
+ row_h = max(row_h, g.bitmap.rows)
218
+
219
+ tex_x = x
220
+ tex_y = y
221
+ tex_data[tex_y:tex_y + g.bitmap.rows,
222
+ tex_x:tex_x + g.bitmap.width].flat = g.bitmap.buffer
223
+
224
+ glyphs[c] = Glyph(g.bitmap_left, g.bitmap_top, w, g.bitmap.rows,
225
+ g.advance.x >> 6,
226
+ (x + do) / tex_w, (y + do) / tex_h,
227
+ (x + w - do) / tex_w,
228
+ (y + g.bitmap.rows - do) / tex_h)
229
+
230
+ x += w
231
+
232
+ return Font(tex_data, glyphs, oversample_log2, asc,
233
+ self.face.size.height, size)
File without changes
@@ -0,0 +1,124 @@
1
+ Bitstream Vera Fonts Copyright
2
+
3
+ The fonts have a generous copyright, allowing derivative works (as
4
+ long as "Bitstream" or "Vera" are not in the names), and full
5
+ redistribution (so long as they are not *sold* by themselves). They
6
+ can be be bundled, redistributed and sold with any software.
7
+
8
+ The fonts are distributed under the following copyright:
9
+
10
+ Copyright
11
+ =========
12
+
13
+ Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
14
+ Vera is a trademark of Bitstream, Inc.
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining
17
+ a copy of the fonts accompanying this license ("Fonts") and associated
18
+ documentation files (the "Font Software"), to reproduce and distribute
19
+ the Font Software, including without limitation the rights to use,
20
+ copy, merge, publish, distribute, and/or sell copies of the Font
21
+ Software, and to permit persons to whom the Font Software is furnished
22
+ to do so, subject to the following conditions:
23
+
24
+ The above copyright and trademark notices and this permission notice
25
+ shall be included in all copies of one or more of the Font Software
26
+ typefaces.
27
+
28
+ The Font Software may be modified, altered, or added to, and in
29
+ particular the designs of glyphs or characters in the Fonts may be
30
+ modified and additional glyphs or characters may be added to the
31
+ Fonts, only if the fonts are renamed to names not containing either
32
+ the words "Bitstream" or the word "Vera".
33
+
34
+ This License becomes null and void to the extent applicable to Fonts
35
+ or Font Software that has been modified and is distributed under the
36
+ "Bitstream Vera" names.
37
+
38
+ The Font Software may be sold as part of a larger software package but
39
+ no copy of one or more of the Font Software typefaces may be sold by
40
+ itself.
41
+
42
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
45
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
46
+ BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
47
+ OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
48
+ OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
49
+ OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
50
+ SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
51
+
52
+ Except as contained in this notice, the names of Gnome, the Gnome
53
+ Foundation, and Bitstream Inc., shall not be used in advertising or
54
+ otherwise to promote the sale, use or other dealings in this Font
55
+ Software without prior written authorization from the Gnome Foundation
56
+ or Bitstream Inc., respectively. For further information, contact:
57
+ fonts at gnome dot org.
58
+
59
+ Copyright FAQ
60
+ =============
61
+
62
+ 1. I don't understand the resale restriction... What gives?
63
+
64
+ Bitstream is giving away these fonts, but wishes to ensure its
65
+ competitors can't just drop the fonts as is into a font sale system
66
+ and sell them as is. It seems fair that if Bitstream can't make money
67
+ from the Bitstream Vera fonts, their competitors should not be able to
68
+ do so either. You can sell the fonts as part of any software package,
69
+ however.
70
+
71
+ 2. I want to package these fonts separately for distribution and
72
+ sale as part of a larger software package or system. Can I do so?
73
+
74
+ Yes. A RPM or Debian package is a "larger software package" to begin
75
+ with, and you aren't selling them independently by themselves.
76
+ See 1. above.
77
+
78
+ 3. Are derivative works allowed?
79
+ Yes!
80
+
81
+ 4. Can I change or add to the font(s)?
82
+ Yes, but you must change the name(s) of the font(s).
83
+
84
+ 5. Under what terms are derivative works allowed?
85
+
86
+ You must change the name(s) of the fonts. This is to ensure the
87
+ quality of the fonts, both to protect Bitstream and Gnome. We want to
88
+ ensure that if an application has opened a font specifically of these
89
+ names, it gets what it expects (though of course, using fontconfig,
90
+ substitutions could still could have occurred during font
91
+ opening). You must include the Bitstream copyright. Additional
92
+ copyrights can be added, as per copyright law. Happy Font Hacking!
93
+
94
+ 6. If I have improvements for Bitstream Vera, is it possible they might get
95
+ adopted in future versions?
96
+
97
+ Yes. The contract between the Gnome Foundation and Bitstream has
98
+ provisions for working with Bitstream to ensure quality additions to
99
+ the Bitstream Vera font family. Please contact us if you have such
100
+ additions. Note, that in general, we will want such additions for the
101
+ entire family, not just a single font, and that you'll have to keep
102
+ both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
103
+ glyphs to the font, they must be stylistically in keeping with Vera's
104
+ design. Vera cannot become a "ransom note" font. Jim Lyles will be
105
+ providing a document describing the design elements used in Vera, as a
106
+ guide and aid for people interested in contributing to Vera.
107
+
108
+ 7. I want to sell a software package that uses these fonts: Can I do so?
109
+
110
+ Sure. Bundle the fonts with your software and sell your software
111
+ with the fonts. That is the intent of the copyright.
112
+
113
+ 8. If applications have built the names "Bitstream Vera" into them,
114
+ can I override this somehow to use fonts of my choosing?
115
+
116
+ This depends on exact details of the software. Most open source
117
+ systems and software (e.g., Gnome, KDE, etc.) are now converting to
118
+ use fontconfig (see www.fontconfig.org) to handle font configuration,
119
+ selection and substitution; it has provisions for overriding font
120
+ names and subsituting alternatives. An example is provided by the
121
+ supplied local.conf file, which chooses the family Bitstream Vera for
122
+ "sans", "serif" and "monospace". Other software (e.g., the XFree86
123
+ core server) has other mechanisms for font substitution.
124
+
@@ -0,0 +1,11 @@
1
+ Contained herin is the Bitstream Vera font family.
2
+
3
+ The Copyright information is found in the COPYRIGHT.TXT file (along
4
+ with being incoporated into the fonts themselves).
5
+
6
+ The releases notes are found in the file "RELEASENOTES.TXT".
7
+
8
+ We hope you enjoy Vera!
9
+
10
+ Bitstream, Inc.
11
+ The Gnome Project