@windfonts/chinese-fonts
v1.0.9
Published
Chinese web fonts with CDN links and comprehensive license information
Maintainers
Readme
Chinese Fonts CDN
A collection of Chinese web fonts with CDN links and comprehensive license information.
Installation
npm i @windfonts/chinese-fontsUsage
Method 1: Auto-load (Recommended)
Simply import and the font will be automatically loaded:
// Import and auto-load with default subset (zh-common)
const { loadFont } = require('@windfonts/chinese-fonts');
// Load a font (returns Promise)
loadFont('Albbpht-Bold').then(cssUrl => {
console.log('Font loaded:', cssUrl);
// Font is now available to use
});
// Load with specific subset
loadFont('Albbpht-Bold', { subset: 'zh-common' });
// Load with preload for better performance
loadFont('Albbpht-Bold', { subset: 'zh-common', preload: true });Method 2: Individual Font Import
Import specific fonts directly:
// Import a specific font
const font = require('@windfonts/chinese-fonts/fonts/Albbpht-Bold');
// Load the font (auto-loads with default subset)
font().then(cssUrl => {
console.log('Font loaded:', cssUrl);
});
// Or with options
font({ subset: 'en' }).then(cssUrl => {
console.log('English subset loaded:', cssUrl);
});
// Access font information
console.log(font.fontName); // Font name
console.log(font.info); // Full font information
console.log(font.getSubsets()); // Available subsets
console.log(font.getCSS('zh-common')); // Get CSS URL without loadingMethod 3: Manual CSS URL
Get the CSS URL without auto-loading:
const { getFontCSS, getFontSubsets } = require('@windfonts/chinese-fonts');
// Get CSS URL
const cssUrl = getFontCSS('Albbpht-Bold', 'zh-common');
console.log(`CSS URL: ${cssUrl}`);
// Get available subsets
const subsets = getFontSubsets('Albbpht-Bold');
console.log(`Available subsets: ${subsets.join(', ')}`);
// Manually add to HTML
// <link rel="stylesheet" href="${cssUrl}">License Information API
This package provides comprehensive license information for each font:
const { getLicenseType, getLicenseUrl, getUsageRights } = require('@windfonts/chinese-fonts');
// Get license type
const licenseType = getLicenseType('FontName');
console.log(`License: ${licenseType}`); // e.g., 'OFL', 'MIT', 'Apache-2.0'
// Get license file URL
const licenseUrl = getLicenseUrl('FontName');
console.log(`License URL: ${licenseUrl}`);
// Get detailed usage rights
const rights = getUsageRights('FontName');
console.log(`Commercial use: ${rights.commercial}`);
console.log(`Modification: ${rights.modification}`);
console.log(`Distribution: ${rights.distribution}`);
console.log(`Private use: ${rights.privateUse}`);Available Fonts
This package includes 169 fonts:
Alibaba-PuHuiTi-B
- Family: Albbpht
- Subfamily: Bold
- Available Subsets: zh-common, en, zh, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Albbpht/Bold/zh-common/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Albbpht/Bold/zh-common/result.css">Alibaba-PuHuiTi-H
- Family: Albbpht
- Subfamily: Regular
- Available Subsets: zh, zh-common, full, en
- CSS URL: https://cn.windfonts.com/fonts-packages/Albbpht/Heavy/zh/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Albbpht/Heavy/zh/result.css">Alibaba-PuHuiTi-L
- Family: Albbpht
- Subfamily: Regular
- Available Subsets: zh-common, en, zh, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Albbpht/Light/zh-common/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Albbpht/Light/zh-common/result.css">Alibaba-PuHuiTi-M
- Family: Albbpht
- Subfamily: Regular
- Available Subsets: en, zh-common, full, zh
- CSS URL: https://cn.windfonts.com/fonts-packages/Albbpht/Medium/en/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Albbpht/Medium/en/result.css">Alibaba-PuHuiTi-R
- Family: Albbpht
- Subfamily: Regular
- Available Subsets: zh-common, en, zh, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Albbpht/Regular/zh-common/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Albbpht/Regular/zh-common/result.css">AliHYAiHei
- Family: Alhyznht
- Subfamily: Regular
- Available Subsets: zh, en, zh-common, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Alhyznht/Regular/zh/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Alhyznht/Regular/zh/result.css">AlimamaDongFangDaKai
- Family: Almmdfdk
- Subfamily: Regular
- Available Subsets: zh, en, zh-common, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Almmdfdk/Regular/zh/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Almmdfdk/Regular/zh/result.css">Alimama DaoLiTi
- Family: Almmdlt
- Subfamily: Regular
- Available Subsets: zh-common, en, zh, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Almmdlt/Regular/zh-common/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Almmdlt/Regular/zh-common/result.css">Alimama ShuHeiTi
- Family: Almmsht
- Subfamily: Regular
- Available Subsets: zh, en, zh-common, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Almmsht/Bold/zh/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Almmsht/Bold/zh/result.css">Droid Sans Fallback
- Family: Azbzzwzt
- Subfamily: Regular
- Available Subsets: zh, en, zh-common, full
- CSS URL: https://cn.windfonts.com/fonts-packages/Azbzzwzt/Regular/zh/result.css
- License: Unknown
- License URL: Not available
- Commercial Use: ❌ Not allowed
Usage:
<link rel="stylesheet" href="https://cn.windfonts.com/fonts-packages/Azbzzwzt/Regular/zh/result.css">... and 159 more fonts.
TypeScript Support
This package includes TypeScript type definitions:
import { FontInfo, UsageRights, getAllFonts, getFontInfo } from '@windfonts/chinese-fonts';
const fonts: string[] = getAllFonts();
const fontInfo: FontInfo | undefined = getFontInfo('FontName');License
Each font has its own license. Please check the license information for each font before use.
Contributing
To add new fonts or update existing ones, please submit a pull request to the repository.
