Skip to content

Commit

Permalink
v0.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvianen committed Jan 5, 2024
1 parent 3c7e0a2 commit 4d7053c
Show file tree
Hide file tree
Showing 15 changed files with 488 additions and 244 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.35
0.0.36
13 changes: 13 additions & 0 deletions dist/js/class/FontGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
declare class FontGenerator {
/**
* Configuration for the TypeScript compiler.
*/
private config;
/**
* Default configuration for the TypeScript compiler.
*/
private static defaultConfig;
/**
* Constructs an instance with merged configuration of default and custom options.
* @param {svgSprite.Config} customConfig - Optional custom configuration object for svg-sprite.
*/
constructor(customConfig?: any);
generateFonts(sourceDirectory: string, outputDiectory: string): Promise<void>;
}
export default FontGenerator;
88 changes: 21 additions & 67 deletions dist/js/class/FontGenerator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"use strict";
// class/FontGenerator.ts
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// Copyright 2023 Scape Agency BV
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,81 +18,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
// Import
// ============================================================================
var fantasticon_1 = require("fantasticon");
var fantasticon_config_js_1 = __importDefault(require("../config/fantasticon.config.js"));
// ============================================================================
// Classes
// ============================================================================
class FontGenerator {
/**
* Default configuration for the TypeScript compiler.
*/
static { this.defaultConfig = fantasticon_config_js_1.default; }
// private static defaultConfig: CompilerOptions = tsConfig;
/**
* Constructs an instance with merged configuration of default and custom options.
* @param {svgSprite.Config} customConfig - Optional custom configuration object for svg-sprite.
*/
constructor(customConfig = {}) {
this.config = {
...FontGenerator.defaultConfig,
...customConfig
};
}
async generateFonts(sourceDirectory, outputDiectory) {
const config = {
...this.config,
// RunnerMandatoryOptions
inputDir: sourceDirectory, // (required)
outputDir: outputDiectory, // (required)
// RunnerOptionalOptions
name: 'icon.gl',
fontTypes: [
fantasticon_1.FontAssetType.TTF, // TTF = "ttf"
fantasticon_1.FontAssetType.WOFF, // WOFF = "woff"
fantasticon_1.FontAssetType.WOFF2, // WOFF2 = "woff2"
fantasticon_1.FontAssetType.EOT, // EOT = "eot"
fantasticon_1.FontAssetType.SVG, // SVG = "svg"
],
assetTypes: [
fantasticon_1.OtherAssetType.CSS, // CSS = "css",
fantasticon_1.OtherAssetType.SCSS, // SCSS = "scss",
fantasticon_1.OtherAssetType.SASS, // SASS = "sass",
fantasticon_1.OtherAssetType.HTML, // HTML = "html",
fantasticon_1.OtherAssetType.JSON, // JSON = "json",
fantasticon_1.OtherAssetType.TS, // TS = "ts"
],
formatOptions: {
// woff: {
// // Woff Extended Metadata Block - see https://www.w3.org/TR/WOFF/#Metadata
// metadata: '...'
// },
// ttf?: TtfOptions; // type TtfOptions = svg2ttf.FontOptions;
// svg?: SvgOptions; // type SvgOptions = Omit<SvgIcons2FontOptions, 'fontName' | 'fontHeight' | 'descent' | 'normalize'>;
json: {
indent: 4
},
ts: {
// select what kind of types you want to generate
// (default `['enum', 'constant', 'literalId', 'literalKey']`)
types: ['enum', 'constant', 'literalId', 'literalKey'],
// render the types with `'` instead of `"` (default is `"`)
singleQuotes: false,
// customise names used for the generated types and constants
enumName: 'icon_gl',
constantName: 'MY_CODEPOINTS'
// literalIdName: 'IconId',
// literalKeyName: 'IconKey'
}
},
pathOptions: {
json: './dist/font/icon.gl.json',
css: './dist/font/icon.gl.css',
scss: './dist/font/icon.gl.scss',
woff: './dist/font/icon.gl.woff',
woff2: './dist/font/icon.gl.woff2'
},
// codepoints: {
// 'chevron-left': 57344, // decimal representation of 0xe000
// 'chevron-right': 57345,
// 'thumbs-up': 57358,
// 'thumbs-down': 57359,
// },
// fontHeight: number;
// descent: number;
// normalize: boolean;
// round: number;
selector: '.igl',
// tag: string;
// Use our custom Handlebars templates
// templates: {
// css: './build/font/icon.gl.css.hbs',
// scss: './build/font/icon.gl.scss.hbs'
// },
prefix: 'igl',
fontsUrl: './fonts'
outputDir: outputDiectory
};
try {
await (0, fantasticon_1.generateFonts)(config);
Expand Down
2 changes: 2 additions & 0 deletions dist/js/config/fantasticon.config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare const fantasticonConfig: any;
export default fantasticonConfig;
159 changes: 159 additions & 0 deletions dist/js/config/fantasticon.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
"use strict";
// config/fantasticon.config.ts
Object.defineProperty(exports, "__esModule", { value: true });
// Copyright 2023 Scape Agency BV
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ============================================================================
// Import
// ============================================================================
var fantasticon_1 = require("fantasticon");
const fantasticonConfig = {
// RunnerOptionalOptions
name: 'icon.gl',
fontTypes: [
fantasticon_1.FontAssetType.TTF, // TTF = "ttf"
fantasticon_1.FontAssetType.WOFF, // WOFF = "woff"
fantasticon_1.FontAssetType.WOFF2, // WOFF2 = "woff2"
fantasticon_1.FontAssetType.EOT, // EOT = "eot"
fantasticon_1.FontAssetType.SVG, // SVG = "svg"
],
assetTypes: [
fantasticon_1.OtherAssetType.CSS, // CSS = "css",
fantasticon_1.OtherAssetType.SCSS, // SCSS = "scss",
fantasticon_1.OtherAssetType.SASS, // SASS = "sass",
fantasticon_1.OtherAssetType.HTML, // HTML = "html",
fantasticon_1.OtherAssetType.JSON, // JSON = "json",
fantasticon_1.OtherAssetType.TS, // TS = "ts"
],
formatOptions: {
// woff: {
// // // Woff Extended Metadata Block - see https://www.w3.org/TR/WOFF/#Metadata
// // metadata: '...'
// // },
// // ttf?: TtfOptions; // type TtfOptions = svg2ttf.FontOptions;
// // svg?: SvgOptions; // type SvgOptions = Omit<SvgIcons2FontOptions, 'fontName' | 'fontHeight' | 'descent' | 'normalize'>;
json: { indent: 4 },
ts: {
// select what kind of types you want to generate
// (default `['enum', 'constant', 'literalId', 'literalKey']`)
// render the types with `'` instead of `"` (default is `"`)
singleQuotes: false,
enumName: 'icon_gl',
// customise names used for the generated types and constants
constantName: 'MY_CODEPOINTS'
// literalIdName: 'IconId',
}
},
pathOptions: {
json: './dist/font/icon.gl.json',
css: './dist/font/icon.gl.css',
scss: './dist/font/icon.gl.scss',
woff: './dist/font/icon.gl.woff',
woff2: './dist/font/icon.gl.woff2'
},
// codepoints: {
// 'chevron-left': 57344, // decimal representation of 0xe000
// 'chevron-right': 57345,
// 'thumbs-up': 57358,
// 'thumbs-down': 57359,
// },
// fontHeight: number;
// descent: number;
// normalize: boolean;
// round: number;
selector: '.igl',
// tag: string;
// Use our custom Handlebars templates
// templates: {
// css: './build/font/icon.gl.css.hbs',
// scss: './build/font/icon.gl.scss.hbs'
// },
prefix: 'icon',
fontsUrl: './fonts'
};
exports.default = fantasticonConfig;
// export const fontConfig = {
// // RunnerMandatoryOptions
// inputDir: sourceDirectory, // (required)
// outputDir: outputDiectory, // (required)
// // RunnerOptionalOptions
// name: 'icon.gl',
// fontTypes: [
// FontAssetType.TTF, // TTF = "ttf"
// FontAssetType.WOFF, // WOFF = "woff"
// FontAssetType.WOFF2, // WOFF2 = "woff2"
// FontAssetType.EOT, // EOT = "eot"
// FontAssetType.SVG, // SVG = "svg"
// ],
// assetTypes: [
// OtherAssetType.CSS, // CSS = "css",
// OtherAssetType.SCSS, // SCSS = "scss",
// OtherAssetType.SASS, // SASS = "sass",
// OtherAssetType.HTML, // HTML = "html",
// OtherAssetType.JSON, // JSON = "json",
// OtherAssetType.TS, // TS = "ts"
// ],
// formatOptions: {
// // woff: {
// // // Woff Extended Metadata Block - see https://www.w3.org/TR/WOFF/#Metadata
// // metadata: '...'
// // },
// // ttf?: TtfOptions; // type TtfOptions = svg2ttf.FontOptions;
// // svg?: SvgOptions; // type SvgOptions = Omit<SvgIcons2FontOptions, 'fontName' | 'fontHeight' | 'descent' | 'normalize'>;
// json: { indent: 4 } ,
// // ts: {
// // // select what kind of types you want to generate
// // // (default `['enum', 'constant', 'literalId', 'literalKey']`)
// // types: ['enum', 'constant', 'literalId', 'literalKey'],
// // // render the types with `'` instead of `"` (default is `"`)
// // singleQuotes: false,
// // // customise names used for the generated types and constants
// // enumName: 'icon_gl',
// // constantName: 'MY_CODEPOINTS'
// // // literalIdName: 'IconId',
// // // literalKeyName: 'IconKey'
// // }
// },
// pathOptions: {
// json: './dist/font/icon.gl.json',
// css: './dist/font/icon.gl.css',
// scss: './dist/font/icon.gl.scss',
// woff: './dist/font/icon.gl.woff',
// woff2: './dist/font/icon.gl.woff2',
// },
// // codepoints: {
// // 'chevron-left': 57344, // decimal representation of 0xe000
// // 'chevron-right': 57345,
// // 'thumbs-up': 57358,
// // 'thumbs-down': 57359,
// // },
// // fontHeight: number;
// // descent: number;
// // normalize: boolean;
// // round: number;
// selector: '.igl',
// // tag: string;
// // Use our custom Handlebars templates
// // templates: {
// // css: './build/font/icon.gl.css.hbs',
// // scss: './build/font/icon.gl.scss.hbs'
// // },
// prefix: 'igl',
// fontsUrl: './fonts',
// // Customize generated icon IDs (unavailable with `.json` config file)
// // getIconId: ({
// // basename, // `string` - Example: 'foo';
// // relativeDirPath, // `string` - Example: 'sub/dir/foo.svg'
// // absoluteFilePath, // `string` - Example: '/var/icons/sub/dir/foo.svg'
// // relativeFilePath, // `string` - Example: 'foo.svg'
// // index // `number` - Example: `0`
// // }) => [index, basename].join('_') // '0_foo'
// };
2 changes: 1 addition & 1 deletion dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pack.gl",
"version": "0.0.35",
"version": "0.0.36",
"description": "Package Builder.",
"keywords": [
"pack.gl",
Expand Down

0 comments on commit 4d7053c

Please sign in to comment.