Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
font-previews
Advanced tools
Readme
Preview images of Google Fonts, for use in font pickers, etc.
The output/google-fonts.json
file contains metadata for the normal style/weight of all the fonts:
{
"name": "ABeeZee",
"category": "Sans Serif",
"popularity": 175,
"trending": 657,
"dateAdded": "2012-09-30",
"img": "abeezee-normal-400.webp",
"base64": "UklGRqQCAABXRUJQ..."
}
The output/google-fonts-all-styles.json
file contains metadata for every style/weight of every font:
{
"name": "ABeeZee",
"category": "Sans Serif",
"popularity": 175,
"trending": 657,
"dateAdded": "2012-09-30",
"styles": [
{
"img": "abeezee-normal-400.webp",
"type": "normal",
"weight": 400,
"img": "abeezee-normal-400.webp",
"base64": "UklGRqQCAABXRUJQ..."
},
{
"img": "abeezee-italic-400.webp",
"type": "italic",
"weight": 400,
"base64": "UklGRqQCAABXRUJQ..."
}
]
}
Each font references the webp
image name, and also includes the base64
encoded image data.
It is recommended that you filter and/or condense the data to reduce the file size. For example, you will want to choose to either the webp or base64 image data, and remove the other. You probably also want to remove the extra metadata that is not needed for your use case.
You can create a nodejs script in your project that imports the data, and modifies it:
import fontList from 'font-previews/output/google-fonts.json' assert {type: 'json'};
import fs from 'node:fs';
// sort by popularity
const sorted = fontList.sort((a, b) => {
return a.popularity - b.popularity;
});
// only include data we need
const newData = sorted.map(font => {
return [
font.name,
font.category,
font.base64
];
});
fs.writeFileSync('newData.json', JSON.stringify(newData));
FAQs
Preview images of Google Fonts, for use in font pickers, etc.
The npm package font-previews receives a total of 0 weekly downloads. As such, font-previews popularity was classified as not popular.
We found that font-previews demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.