-
Notifications
You must be signed in to change notification settings - Fork 2
/
SPEC.txt
775 lines (691 loc) · 31.3 KB
/
SPEC.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
DATABASE
----------------------------------------
/ | \
PROJECTS MANAGERS USERS (with read and/or write authorization for the projects)
/ | \
PROJECT_1 PROJECT_2 PROJECT_3
|
------------------------------------------------------------------------------------------------------------------
/ | | | | \
FontLib GlyphComposition Proofing AtomicElement DeepComponent CharacterGlyphs
| | | / \ | / \ \
.json file .json file users folders / .glif files .glif files / \ .glif files
| / / \
.pdf and .mp4 files / / \
/ / \
layers folders layers folders \
| | \
.glif files .glif files \
Backup folders
|
.glif files
PROJECT / FONT :
• FontLib :
___________
Contains differents data like:
- CJK Design Frame -> dict
- Default glyphs width -> integer
- Font Variation axes names -> List
- And we can have others...
Currently it's store as a JSON file
WHAT WE NEED FROM MYSQL:
- Load the full json from mysql database
- Load one key and its values
- Modify the values of a key
- Remove a key
- Create new keys
#########################################
• GlyphComposition :
____________________
Contains the project's characterset.
For each characters there is its composition
Currently it's store as a JSON file
WHAT WE NEED FROM MYSQL:
- Load the full json from mysql database
- Load one key and its values
- Modify the values of a key
- Remove a key
- Create new keys
https://github.com/BlackFoundryCom/HanGlyphComposition/blob/master/GlyphsDeepComposition/Characters2DeepComponents.txt
#########################################
• Proofing :
____________
Contains .PDF and .mp4 files
We will have a folder for each users, where they will generate PDF files
for instance:
Proofing / Gaetan_Baehr / 20200817_143412_00_FontName_Weight.pdf
The pdf name is YearMonthDay_HourMinuteSecond_PageNumber_FontName_Weight.pdf, we will have one PDF per page, that's why there is the page number in the name
.mp4 files will be generated in a specific folder or at the root of the proofing folder
the .pdf and .mp4 are generated by RoboCJK. PDF can be modified then with another application than Robocjk/Robofont. These modification should be saved
Maybe it's not a good idea to stored them in mysql database, maybe it's better to have a separate git repository for that ???
Anyway, in case we store it in mysql
WHAT WE NEED FROM MYSQL:
- Load all the PDFs
- Load the PDFs of a users
- Load one PDF
- Save a PDF (from robocjk or from external application)
- Load the all the mp4
- Load the one mp4
- Save a mp4
#########################################
• AtomicElements :
__________________
Contains .glif files (xml) and folders for the glyph's layers. These folders contains as well .glif files.
( Atomic elements will be used only by deep components )
An atomic element is made of outlines, stored in the glyph foreground.
All its variations are made of outlines as well, compatible with the foreground, stored in a specific layer.
for instance we will take an atomic element named 'stem' with one variation axis named 'wght'.
'stem' will have the master outlines in the foreground, and the outlines for variation in a layer.
This layer will be named as we want, not necessarly the variation axis name, for instance 'layer1'.
In the foreground lib we will have the correspondance between the variation axis name 'wght' and the layer name 'layer1' were we stored the outlines.
the master xml will be stored at the root of the atomicElements folder as stem.glif, and in each layers that contains a variation of this glyph, the layer xml will be stored as 'stem.glif' as well.
---------
AtomicElements folder / -> stem.glif
\
Layer1 folder / -> stem.glif
---------
xml example of stem.glif at the root of AtomicElements folder:
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="stem" format="2">
<advance width="1000"/>
<outline>
<contour>
<point x="0" y="0" type="line"/>
<point x="1000" y="0" type="line"/>
<point x="-1000" y="1000" type="line"/>
<point x="-2000" y="1000" type="line"/>
</contour>
</outline>
<lib>
<dict>
<key>robocjk.glyphVariationGlyphs</key>
<dict>
<key>wght</key>
<dict>
<key>content</key>
<dict>
<key>deepComponents</key>
<array/>
<key>outlines</key>
<array>
<array>
<string>moveTo</string>
<array>
<array>
<integer>0</integer>
<integer>0</integer>
</array>
</array>
</array>
<array>
<string>lineTo</string>
<array>
<array>
<integer>1000</integer>
<integer>0</integer>
</array>
</array>
</array>
<array>
<string>lineTo</string>
<array>
<array>
<integer>3000</integer>
<integer>1000</integer>
</array>
</array>
</array>
<array>
<string>lineTo</string>
<array>
<array>
<integer>2000</integer>
<integer>1000</integer>
</array>
</array>
</array>
<array>
<string>closePath</string>
<array/>
</array>
</array>
<key>width</key>
<integer>1000</integer>
</dict>
<key>layerName</key>
<string>layer1</string>
<key>maxValue</key>
<real>1000.0</real>
<key>minValue</key>
<real>0.0</real>
</dict>
</dict>
</dict>
</lib>
</glyph>
xml example of stem.glif stored in the 'layer1' made for the 'wght' axis:
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="stem" format="2">
<advance width="1000"/>
<outline>
<contour>
<point x="0" y="0" type="line"/>
<point x="1000" y="0" type="line"/>
<point x="3000" y="1000" type="line"/>
<point x="2000" y="1000" type="line"/>
</contour>
</outline>
</glyph>
WHAT WE NEED FROM MYSQL:
- Load all the atomic elements
- Load one atomic element
- Save the atomic element (xml of the foreground and xml of its layers) (Save can work only if the glyph is lock by the user)
- Add layer to the atomic element
- Remove layer to the atomic element
- Create new atomic element (means an empty glyph xml)
- Remove atomic element (and its layers)
- Duplicate atomic element (and its layers)
- Rename atomic element (and its layers)
- Lock atomic element
- Unlock atomic element
- Know who lock a selected atomic element
- Know all the atomic element locked by a user
- Nice to have a push on a git repo after any save and unlock
To create an empty glyph xml we need to know the glyph name, and take the Default glyphs width stored in the fontlib.
If the glyph name start with 'uni' and follow with only hexadecimal characters we can guess its unicode
empty glyph xml example, with unicode guessed:
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="TheGlyphName" format="2">
<advance width="DefaultGlyphWidth"/>
<unicode hex="glyphUnicode"/>
<outline>
</outline>
</glyph>
empty glyph xml example, without unicode:
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="TheGlyphName" format="2">
<advance width="DefaultGlyphWidth"/>
<outline>
</outline>
</glyph>
#########################################
• DeepComponents :
__________________
Contains .glif files (xml), currently there is no need of layers for the deep components.
In a deep component xml we work only with the glyph lib. There is, normaly, no outlines.
in the glyph lib we have three keys:
- public.markColor
- robocjk.deepComponents
- robocjk.glyphVariationGlyphs
These keys stored actually the atomic elements instances.
xml example of the deep component D_C__4567_00.glif (Good to know, there is a norme for the .glif names, it's not exactly the glyph name, you will find a function for that in robocjk/sources/utils/files.py named userNameToFileName):
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="DC_4567_00" format="2">
<advance width="1000"/>
<outline>
</outline>
<lib>
<dict>
<key>public.markColor</key>
<string>0,1,0.5,1</string>
<key>robocjk.deepComponents</key>
<array>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>name</key>
<string>stem</string>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>-90</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>2</integer>
<key>y</key>
<integer>528</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>name</key>
<string>stem</string>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>500</integer>
<key>y</key>
<integer>0</integer>
</dict>
</array>
<key>robocjk.glyphVariationGlyphs</key>
<dict>
<key>hght</key>
<dict>
<key>content</key>
<dict>
<key>deepComponents</key>
<array>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>-90</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>2</integer>
<key>y</key>
<integer>528</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<real>0.2</real>
<key>x</key>
<integer>500</integer>
<key>y</key>
<integer>400</integer>
</dict>
</array>
<key>outlines</key>
<array/>
<key>width</key>
<integer>1000</integer>
</dict>
<key>layerName</key>
<string></string>
<key>maxValue</key>
<real>1.0</real>
<key>minValue</key>
<real>0.0</real>
</dict>
<key>wdth</key>
<dict>
<key>content</key>
<dict>
<key>deepComponents</key>
<array>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>-90</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<real>0.4</real>
<key>x</key>
<integer>340</integer>
<key>y</key>
<integer>528</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>DIAG</key>
<real>0.5</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>0.07</real>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>500</integer>
<key>y</key>
<integer>0</integer>
</dict>
</array>
<key>outlines</key>
<array/>
<key>width</key>
<integer>1000</integer>
</dict>
<key>layerName</key>
<string></string>
<key>maxValue</key>
<real>1.0</real>
<key>minValue</key>
<real>0.0</real>
</dict>
</dict>
</dict>
</lib>
</glyph>
WHAT WE NEED FROM MYSQL:
- Load all the deep components
- Load one deep component
- Load all deep component that belongs (locked) to a given user
- Save the deep component (Save can work only if the glyph is lock by the user)
- Create new deep component -> it automatically lock the glyph for the user who create it
- Remove deep component -> only if the user locked it
- Duplicate deep component -> only if the user locked it
- Rename deep component -> only if the user locked it
- Lock deep component
- Unlock deep component
- Load the mark color of the deep component
- Know all the deep components that use a given mark color
- Know if the deep component is empty or not (empty means that there is no atomic elements instance inside)
- Know if the deep component has variations axis
- Know who lock a selected deep component
- Know all the deep components locked by a user
- Know if the / or what deep components contains outlines
- Know what atomic elements are instanciate in a deep component (their names are stored in the 'robocjk.deepComponents' key)
- If an atomic element is renamed or removed, it should be updated in the deep components that used it. And if someone is working on the deep component, we should have a way to notify the user.
- Nice to have a push on a git repo after any save and unlock
#########################################
• CharacterGlyphs :
___________________
Contains .glif files (xml) and folders for the glyph's layers. These folders contains as well .glif files.
The character glyphs can contains outlines and/or deep components instances, or even flat components (made of character glyphs) that are actually the fontParts component object.
in the glyph lib we have three keys:
- public.markColor
- robocjk.deepComponents
- robocjk.glyphVariationGlyphs
The glyphs variations names can only be the Font Variation axes names stored in the fontlib.
The glyphs variations for the deep components instances are stored in the glyph lib in the 'robocjk.glyphVariationGlyphs' key.
In case of a glyph with outlines and/or flat components, its outlines variations and flat components variation are stored in a layer. This layer will be named with the variation axis name.
When a character glyph is supposed to be done, we will have a decomposition of its deep components in layers named backup_ and the axis name.
xml example of the character glyph uni547E_ :
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="uni547E" format="2">
<advance width="1000"/>
<unicode hex="547E"/>
<outline>
</outline>
<lib>
<dict>
<key>robocjk.deepComponents</key>
<array>
<dict>
<key>coord</key>
<dict>
<key>HGHT</key>
<real>0.441</real>
<key>HWGT</key>
<real>0.317</real>
<key>LLNGG</key>
<real>0.337</real>
<key>RLNG</key>
<real>0.0</real>
<key>VWGT</key>
<real>0.353</real>
<key>WDTH</key>
<real>0.803</real>
</dict>
<key>name</key>
<string>DC_53E3_00</string>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>1.0</real>
<key>scaley</key>
<real>1.0</real>
<key>x</key>
<integer>-251</integer>
<key>y</key>
<integer>70</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>HGHT</key>
<real>0.454</real>
<key>HWGT</key>
<real>0.334</real>
<key>LLNG</key>
<integer>0</integer>
<key>RLNG</key>
<integer>0</integer>
<key>VWGT</key>
<real>0.37</real>
<key>WDTH</key>
<real>0.658</real>
</dict>
<key>name</key>
<string>DC_65E5_00</string>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<integer>1</integer>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>176</integer>
<key>y</key>
<integer>90</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>WGHT</key>
<real>0.316</real>
</dict>
<key>name</key>
<string>DC_4E00_00</string>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>0.5559999999999998</real>
<key>scaley</key>
<real>1.008</real>
<key>x</key>
<integer>392</integer>
<key>y</key>
<integer>-372</integer>
</dict>
</array>
<key>robocjk.fontVariationGlyphs</key>
<dict>
<key>WGHT</key>
<dict>
<key>content</key>
<dict>
<key>deepComponents</key>
<array>
<dict>
<key>coord</key>
<dict>
<key>HGHT</key>
<real>0.441</real>
<key>HWGT</key>
<real>0.503</real>
<key>LLNGG</key>
<real>0.393</real>
<key>RLNG</key>
<real>0.0</real>
<key>VWGT</key>
<real>0.484</real>
<key>WDTH</key>
<real>0.803</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>1.0</real>
<key>scaley</key>
<real>1.0</real>
<key>x</key>
<integer>-251</integer>
<key>y</key>
<integer>70</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>HGHT</key>
<real>0.454</real>
<key>HWGT</key>
<real>0.534</real>
<key>LLNG</key>
<integer>0</integer>
<key>RLNG</key>
<integer>0</integer>
<key>VWGT</key>
<real>0.504</real>
<key>WDTH</key>
<real>0.658</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<integer>1</integer>
<key>scaley</key>
<integer>1</integer>
<key>x</key>
<integer>176</integer>
<key>y</key>
<integer>90</integer>
</dict>
<dict>
<key>coord</key>
<dict>
<key>WGHT</key>
<real>0.548</real>
</dict>
<key>rcenterx</key>
<integer>0</integer>
<key>rcentery</key>
<integer>0</integer>
<key>rotation</key>
<integer>0</integer>
<key>scalex</key>
<real>0.5559999999999998</real>
<key>scaley</key>
<real>1.008</real>
<key>x</key>
<integer>392</integer>
<key>y</key>
<integer>-372</integer>
</dict>
</array>
<key>outlines</key>
<array/>
<key>width</key>
<integer>500</integer>
</dict>
<key>layerName</key>
<string>WGHT</string>
<key>maxValue</key>
<real>1.0</real>
<key>minValue</key>
<real>0.0</real>
</dict>
</dict>
</dict>
</lib>
</glyph>
WHAT WE NEED FROM MYSQL:
- Load all the character glyphs
- Load one character glyph
- Load all character glyphs that belongs (locked) to a given user
- Save the character glyph (xml of the foreground and xml of its layers) (Save can work only if the glyph is lock by the user)
- Add layer to the character glyph
- Remove layer to the character glyph
- Create new character glyph -> it automatically lock the glyph for the user who create it
- Remove character glyph and its layers -> only if the user locked it
- Duplicate character glyph and its layers -> only if the user locked it
- Rename character glyph and its layers -> only if the user locked it
- Lock character glyph
- Unlock character glyph
- Load the mark color of the character glyph
- Know all the character glyphs that use a given mark color
- Know if the character glyph is empty or not (empty means that there is no deep components instance inside, and no contours and not flat components)
- Know if the character glyph has variations axis
- Know who lock a selected character glyph
- Know all the dcharacter glyph locked by a user
- Know if the / or what character glyph contains outlines
- Know what deep components are instanciate in a character glyph (their names are stored in the 'robocjk.deepComponents' key)
- If a deep component is renamed or removed, it should be updated in the character glyphs that used it. And if someone is working on the character glyph, we should have a way to notify the user.
- Nice to have a push on a git repo after any save and unlock
##################################################################################
MANAGERS:
This part does not already exist in our mysql prototype and even in our git based robocjk
The managers will create / remove / rename / duplicate project, and add / remove users and give them their read / write authorization.
WHAT WE NEED FROM MYSQL:
- Create new empty project
- Remove project
- Rename project
- Duplicate project
- add manager
- Remove manager
- Add user
- Remove user
- give read / write access to user
----
an atomic element is made of outlines and layers
a deep component is made of atomic elements
a character glyph is made of deep component and/or outlines and layers in this case