blackfoundrycom / fontra-rcjk Goto Github PK
View Code? Open in Web Editor NEWFontra plug-in with django-robocjk support and .rcjk file format support
License: GNU General Public License v3.0
Fontra plug-in with django-robocjk support and .rcjk file format support
License: GNU General Public License v3.0
For example:
public.markColor
We should probably always parse the original data first before applying our changes, just like the designspace backend does.
This repository is mostly library code, that can be useful outside of the Fontra app. I think we should change the license to Apache.
Relates to googlefonts/fontra#548
fontra-rcjk is really two things:
These two share a lot of code, but conceptually only the second item is truly library code.
2024-04-15 16:00:57 aiohttp.server ERROR Error handling request
Traceback (most recent call last):
File "/Users/just/code/git/BlackFoundry/fontra/venv/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/just/code/git/BlackFoundry/fontra/venv/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/just/code/git/BlackFoundry/fontra-rcjk/src/fontra_rcjk/projectmanager.py", line 88, in logoutHandler
await client.close()
^^^^^^^^^^^^
AttributeError: 'AuthorizedClient' object has no attribute 'close'. Did you mean: 'aclose'?
The error message contains the likely fix...
Currently, we get an exception when trying to call getGlyph or putGlyph before getGlyphMap was called.
getGlyphMap()
sets up the internal index. It should be called implicitly by getGlyph/putGlyph if it wasn't done before.
This may also affect the filesystem backend.
This will connect googlefonts/fontra#1050 and googlefonts/django-robo-cjk#163
Fontra does not yet support the concept of sources being "on" or "off", so the rcjk "on" flag currently causes a source to be ignored (good) but the source will be gone once written the glyph gets written back to the backend (bad).
This would allow us to convert an existing non-rcjk project to rcjk using fontra-copy.
(Possible sources: designspace/ufo, glyphs, ttf/otf)
Also: putCustomData()
Currently if anything is added to the Note section in RoboFont (in the Inspector panel), Fontra would erase it when saving changes.
Currently, the list of status codes is hard coded:
fontra-rcjk/src/fontra_rcjk/base.py
Lines 447 to 476 in bc0b0f2
This is modeled after RoboCJK where this is also hard coded:
This should be fully configurable.
Question one is: to what extent should RoboCJK still support this as well? Or: can we do it in a way that doesn't necessarily break RoboCJK?
If I understand correctly, the django-robocjk level the status field is just an integer, so we can just use arbitrary int values. @fabiocaccamo, can you confirm this?
Counterpart of googlefonts/fontra#450 and googlefonts/fontra#938
We need a counterpart of googlefonts/fontra#639 in this repo, too.
Error:
2023-01-27 11:07:18 fontra.core.fonthandler ERROR fatal exception in asyncio task <Task finished name='Task-111' coro=<FontHandler.processExternalChanges() done, defined at /Users/just/code/git/BlackFoundry/fontra/src/fontra/core/fonthandler.py:86> exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
File "/Users/just/code/git/BlackFoundry/fontra/src/fontra/core/fonthandler.py", line 87, in processExternalChanges
async for change, reloadPattern in self.backend.watchExternalChanges():
File "/Users/just/code/git/BlackFoundry/fontra-rcjk/src/fontra_rcjk/backend_fs.py", line 150, in watchExternalChanges
if self._recentlyWrittenPaths.pop(path, None) == os.path.getmtime(path):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/genericpath.py", line 55, in getmtime
return os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/project.rcjk/characterGlyph/a.glif'
This may be a combination of two things
The watchfiles oddity probably deserves a wrapper, so that watchfiles client code doesn't need to worry about it.
For testing purposes, you can add an <anchor>
element to tests/data/figArnaud.rcjk/characterGlyph/a.glif
as well as to tests/data/figArnaud.rcjk/characterGlyph/bold/a.glif
For large project, getting the glyph list from the DB can take several seconds. Caching it on-disk should be able to speed this up significantly, even if we add a glif_list call with updated_since to ensure we're up to date.
If a new project gets added or if a user is added to a project, they will not see the project until the Fontra server restarts they log out and log in again.
Counterpart of googlefonts/fontra#1280
Fontra doesn't (yet) have neither a status field like .rcjk has, nor a glyph.lib where we could keep it.
This line:
fontra-rcjk/src/fontra_rcjk/base.py
Line 157 in 559e42b
This is undesirable in the context of multi-source editing, for example copy/paste uses layer names to know where to paste what. It is also causing some of the confusion mentioned in googlefonts/fontra#865.
We should just use the source layer name unless it is not unique.
See googlefonts/django-robo-cjk#108
The name limit is 50 chars. Perhaps the django-rcjk backend can mangle long names and map them back.
If a glyph contains classic components as well as variable components, the classic components are lost.
Also, when writing a glyph, we should avoid mixing the two: if there are any variable components present, all components should be written as variable components.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.