What's New ========== Recent changes — since ``v0.3.0`` --------------------------------- Custom fonts: ``Application.register_font`` / ``set_default_font`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Two new methods on ``Application`` let the Python side ship custom font files to the browser and apply a document-wide default font. .. code-block:: python app.register_font('Roboto', '/path/to/Roboto-Regular.ttf') app.register_font('Roboto', '/path/to/Roboto-Bold.ttf', weight='bold') app.set_default_font('Roboto', size=13) * ``register_font(family, source, *, weight, style)`` -- stores the font bytes in an in-memory registry keyed by a monotonic id; the built-in HTTP server exposes them at ``/_pgwidgets/font/`` with ``Cache-Control: immutable``. Accepts paths (``str`` / ``os.PathLike``) or raw ``bytes``. * ``set_default_font(family, *, size, weight, style)`` -- writes ``--pg-default-font-{family,size,weight,style}`` CSS variables on ``:root`` via a managed ``