Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
fela-font-renderer
Advanced tools
Deprecated!
The Font Renderer Enhancer (fela-font-renderer) is deprecated, please remove it from your Fela configuration.
Font Renderering was heavily improved within Fela making this package obsolete nowadays. See http://fela.js.org/docs/basics/Renderer.html#renderfont
Allocates all renderFont
calls to a separate renderer which renders into a separate mountNode
to prevent refetching the @font-face
every time.
yarn add fela-font-renderer
You may alternatively use npm i --save fela-font-renderer
.
Option | Value | Default | Description |
---|---|---|---|
mountNode | (HTMLElement) | DOM node to render @font-face markup into |
Using the enhancer for client-side rendering can be achieved by simply passing another mountNode
to the enhancer.
import { createRenderer, render } from 'fela'
import fontRenderer from 'fela-font-renderer'
const mountNode = document.getElementById('font-stylesheet')
const fontEnhancer = fontRenderer(mountNode)
const renderer = createRenderer({
enhancers: [ fontEnhancer ]
})
To get the static CSS markup for both renderers can be achieved using the renderer.fontRenderer
to generate the @font-face
markup.
import { createRenderer } from 'fela'
import fontRenderer from 'fela-font-renderer'
const renderer = createRenderer({
enhancers: [ fontRenderer() ]
})
const CSS = renderer.renderToString()
const fontCSS = renderer.fontRenderer.renderToString()
Fela is licensed under the MIT License.
Documentation is licensed under Creative Common License.
Created with ♥ by @rofrischmann and all the great contributors.
FAQs
Fela enhancer to render fonts into a separate stylesheet
The npm package fela-font-renderer receives a total of 50 weekly downloads. As such, fela-font-renderer popularity was classified as not popular.
We found that fela-font-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.