Giter VIP home page Giter VIP logo

fontra-rcjk's Issues

logout causes 500 Internal Server error

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...

rcjk source "on" flag is not implemented correctly

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).

Username cookie is set in double quotes

In certain situations the username string is saved in double quotes.
This is probably caused by the inclusion of certain characters, such as @. The issue is reproducible on all browsers.

Screenshot 2023-03-15 at 10 36 53

The values/meaning/colors of the development status field should be configurable per font.

Currently, the list of status codes is hard coded:

standardFontLibItems = {
"fontra.sourceStatusFieldDefinitions": [
{
"label": "In progress",
"color": (1.0, 0.0, 0.0, 1.0),
"value": 0,
"isDefault": True,
},
{
"label": "Checking-1",
"color": (1.0, 0.5, 0.0, 1.0),
"value": 1,
},
{
"label": "Checking-2",
"color": (1.0, 1.0, 0.0, 1.0),
"value": 2,
},
{
"label": "Checking-3",
"color": (0.0, 0.5, 1.0, 1.0),
"value": 3,
},
{
"label": "Validated",
"color": (0.0, 1.0, 0.5, 1.0),
"value": 4,
},
]
}

This is modeled after RoboCJK where this is also hard coded:

https://github.com/BlackFoundryCom/robo-cjk/blob/4fc4a7b17b607a47bcd088fd3c6b4f31eeb68b7e/sources/utils/colors.py#L29-L56

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?

[backend_fs] externally deleting a glyph does not work with the change watcher

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.

Implement read and write for glyph anchors

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

Project list gets cached, never updated

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.

"virtual" layer names should not depend on source order

This line:

layerName = f"{sourceName}_{sourceIndex}_layer"

makes up a layer name based on the source name. Since source names don't have to be unique, the source index is added to the layer name.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.