Giter Club home page Giter Club logo

glyphcast's People

Contributors

dependabot[bot] avatar edgarrmondragon avatar jboarman avatar polynomialherder avatar proofconstruction avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pafh99

glyphcast's Issues

Add bindings to the `svg2pdf` Rust-based package

This addition would expose an ability to render a PDF from an SVG using a provided set of Options, so the identical will be almost interface to the existing interface to convert SVG to PNG.

Though the Options will vary, we should aim to unify them as much as possible so that we could use the same Options class if that appears possible after exploring this further.

See repo located at https://github.com/typst/svg2pdf. This lib shares many of the same dependencies as resvg so hopefully the size of the final package binary will not be overly affected.

Add all the most common badges to README

For this issue, we need to include adding all the cute little buttons to the README, such as:

  • Build Status
  • Test Coverage
  • License Badge
  • PyPI Version Badge
  • Downloads Badge (showing count for all time)

Trigger build and release on upstream release to `resvg`

Since our key dependency is resvg, we need to ensure we are getting all the latest updates when those are released.

There does not appear to be a GitHub Action trigger available that activates when an update to a dependency is released. So, we will need to come up with a mechanism for identifying the current release number and comparing that to some tracking that within GH Actions, such as use of upload-artifact and download-artifact for tracking that state.

Another approach may be to leverage GitHub's Dependabot to trigger a PR based on the release of a dependency.

Add more tests that check the result of different options

This may be done as the options are added, but this issue tracks the additional work effort and assurance that all the options have test coverage.

  • width
  • height
  • fit_to
  • background
  • dpi
  • text
  • image
  • lang
  • skip_system_fonts
  • font_size
  • font_family
  • font_path

Create Benchmark Comparison to Python Alternative

Benchmark Python Alternatives

resvg's existing benchmark offers a set of over 1,600 SVG files, each prepared with an associated PNG baseline for testing standard's compatibility. This will provide us with a reference dataset for establishing our own metrics for comparing to alternative Python libraries against the full set of test images.

Tests should be performed by converting SVGs to both PNGs and PDFs (as separate timing-level benchmarks).

Alternative Methods to Include in Benchmark

  • CairoSVG
  • Svglib
  • Inkscape

Possible Metrics

  • Python Dependency Count
  • External Dependencies (list of named external dependencies)
  • Size of Python Package (including its Python dependencies)
  • Size of External Depenencies (cairo, ghostscript, inkscape, etc)
  • Speed (total time, lower number is better)
  • Memory Usage
  • Alpha Channel Support
  • Filters Support (see resvg filters support and this example that tests the turbulence filter)
  • SVG-to-PNG Compatibility (based on conformance to PNG baseline image)

Implement the full set of options

The Options class provides customization and configuration options for rendering SVG files. The main options have been documented in the README, but now we need to ensure they are all implemented.

Also, it would be ideal to allow the options to be defined as a dictionary as a possible style for passing the options, so either as a dictionary or instance of a proper Options class.

If there are parameters that are problematic to deal with, we may defer those until later. But, if they are trivial to address now, then we should knock them all out now.

Name Purpose Type Allowed Values Example
width Defines the width of the output image in pixels Integer Positive integers (1 and above) options.width = 300
height Defines the height of the output image in pixels Integer Positive integers (1 and above) options.height = 200
fit_to Controls how the SVG should be scaled to fit the output String or Tuple "original", ("width", value), ("height", value), ("zoom", factor) options.fit_to = ("width", 300)
background Sets the background color of the output image String or None 6 or 8-digit hex color codes or None options.background = "#FFAABB"
dpi Specifies the DPI value used for rendering Float Positive float values (greater than 0) options.dpi = 96.0
languages Sets the list of languages for systemLanguage attribute List of strings Valid BCP 47 language codes options.languages = ["en", "fr", "es"]
shape_rendering Controls the rendering mode for shapes String "optimizeSpeed", "crispEdges", "geometricPrecision options.shape_rendering = "optimizeSpeed"
text_rendering Controls the rendering mode for text String "optimizeSpeed", "optimizeLegibility", "geometricPrecision options.text_rendering = "optimizeLegibility"
image_rendering Controls the rendering mode for images String "optimizeQuality", "optimizeSpeed", "pixelated options.image_rendering = "optimizeQuality"
skip_system_fonts Skip loading system fonts when rendering text Boolean True or False options.skip_system_fonts = True
font_size Specifies the default font size for text elements Float Positive float values (greater than 0) options.font_size = 14.0
font_family Specifies the default font family for text elements String Valid font family names options.font_family = "Arial"
font_path Path to a custom font file String Valid file path options.font_path = "path/to/font.ttf"

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.