
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@dldc/fonts
Advanced tools
Utils to uses fonts weights with Typescript
yarn add ts-fonts
import { Font } from 'ts-fonts';
const MyFont = Font.create('MyFont', {
// for each valid weight
400: {
// specify paths to normal and italic woff and woff2
normal: {
woff: '/path-to-font-normal.woff',
woff2: '/path-to-font-normal.woff2',
},
italic: {
woff: '/path-to-font-italic.woff',
woff2: '/path-to-font-italic.woff2',
},
},
600: {
// You can specify only one of normal and italic
// If woff and woff2 have the same name you can use a string
italic: '/path-to-font-semibold-italic',
},
});
// Inject this in your document to register fonts
MyFont.fontFaces;
// you can now use the font
console.log(MyFont.styles.Regular.Normal);
// { fontFamily: 'MyFont', fontWeight: 400, fontStyle: 'normal' }
console.log(MyFont.styles.Regular.Italic);
// { fontFamily: 'MyFont', fontWeight: 400, fontStyle: 'italic' }
// if the weight has only one style get the object directly
console.log(MyFont.styles.SemiBold);
// { fontFamily: 'MyFont', fontWeight: 600, fontStyle: 'italic' }
You can use any of the following name / number to acces a font.
Note: You have to use numbers to define the object passed to Font.create
export type FontWeight_100 = 100 | 'Thin';
export type FontWeight_200 = 200 | 'ExtraLight' | 'UltraLight';
export type FontWeight_300 = 300 | 'Light';
export type FontWeight_400 = 400 | 'Normal' | 'Book' | 'Regular';
export type FontWeight_500 = 500 | 'Medium';
export type FontWeight_600 = 600 | 'SemiBold' | 'DemiBold';
export type FontWeight_700 = 700 | 'Bold';
export type FontWeight_800 = 800 | 'ExtraBold' | 'UltraBold';
export type FontWeight_900 = 900 | 'Black' | 'Heavy';
Font.resolveFontWeightThis function take any valid font weight name / number and return the corresponding font weight number.
FAQs
A tool to create dynamic colors by interpolating multiple colors
We found that @dldc/fonts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.