GithubHelp home page GithubHelp logo

Ship a font for xkcd plots about pyodide HOT 9 CLOSED

mdboom avatar mdboom commented on July 30, 2024
Ship a font for xkcd plots

from pyodide.

Comments (9)

nixphix avatar nixphix commented on July 30, 2024

Here's a one with permissive licence antiyawn

from pyodide.

rth avatar rth commented on July 30, 2024

Thanks @nixphix ! Would you like to make a Pull Request to add it?

from pyodide.

nixphix avatar nixphix commented on July 30, 2024

from pyodide.

nixphix avatar nixphix commented on July 30, 2024

@rth could you give me some pointer on how to add the font asset

from pyodide.

rth avatar rth commented on July 30, 2024

I'm not exactly sure. There is a packages/matplotlib/src/fontList.json file that lists available fonts available under /lib/python3.7/site-packages/matplotlib/mpl-data in the virtual filesystem of the built package. My guess is that the matplolib setup would need to download this additional font and bundle it in somewhere in the filesystem, then one would need to add an entry to fontList.json. It's 25 kB font file, and not a frequently used one, so adding it needlessly to the main pyodide package is probably not optimal (though possibly acceptable).

@mdboom would have a better understanding of what needs to be done.

from pyodide.

rth avatar rth commented on July 30, 2024

Though the issue is that adding some custom asset is much easier e.g. for the main package (where one can just write the logic in a Makefile) than for a packaged python package (which uses the pyodide_build setup).

Maybe we could add something similar to the build->script entry in conda's meta.yaml, that would allow to run arbitrary code. For instance, here we would then use it to run some code to download this asset after patches are applied in matplotlib, but before the install process happens.

from pyodide.

madhur-tandon avatar madhur-tandon commented on July 30, 2024

@mdboom @rth If no one is working on it, can I be assigned this perhaps? Moreover, can I have some starter tips as well?

from pyodide.

mdboom avatar mdboom commented on July 30, 2024

@madhur-tandon: I've assigned you. @rth's notes above are accurate. It basically needs to be added to the /lib/python3.7/site-packages/matplotlib/mpl-data directory at the time the package is built, and the fontList.json needs to be updated to refer to it. I think the extra size is reasonable -- it's probably not worth the complexity to have it in, for example, another package.

from pyodide.

madhur-tandon avatar madhur-tandon commented on July 30, 2024

@mdboom @rth Made a PR for adding the font asset. Also, It is better to use the post entry in my opinion rather than the script entry in the build section of the meta.yaml file. The reasons for this are mentioned in the PR. I have also included a screenshot for the same as a proof that it works. Please let me know if this is feasible. I guess this is straightforward though.

from pyodide.

Related Issues (20)

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.