![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
fela-font-renderer
Advanced tools
Allocates all renderFont
calls to a separate renderer which renders into a separate mountNode
to prevent refetching the @font-face
every time.
npm i --save fela-font-renderer
Assuming you are using npm as your package manager you can just npm install
.
Otherwise we also provide a UMD. You can easily use it via unpkg. It registers a FelaFontRenderer
global.
<!-- Fela (Development): Unminified version including all warnings -->
<script src="https://unpkg.com/fela-font-renderer@4.3.3/dist/fela-font-renderer.js"></script>
<!-- Fela (Production): Minified version -->
<script src="https://unpkg.com/fela-font-renderer@4.3.3/dist/fela-font-renderer.min.js"></script>
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
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.