Skip to content

Commit

Permalink
fix: export loadFont for /cairo (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Jul 12, 2022
1 parent 25ae647 commit 74d3e81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,8 @@
"extends": "@sapphire"
},
"prettier": "@sapphire/prettier-config",
"packageManager": "yarn@3.2.1"
"packageManager": "yarn@3.2.1",
"volta": {
"node": "16.16.0"
}
}
17 changes: 9 additions & 8 deletions src/main.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ export class Canvas {
* Gets a JPEG buffer. \
* @param config The render configuration. \
* @returns A JPEG buffer. \
* @see {@link jpegAsync} for the async version. \
* @see {@link jpeg} for the sync version. \
*/ \
public jpegAsync(config?: JpegConfig): Promise<Buffer> { \
return this.toBufferAsync('image/jpeg', config); \
Expand All @@ -1855,7 +1855,7 @@ export class Canvas {
* Gets a JPEG buffer. \
* @param quality The quality to use, defaults to `92`. \
* @returns A JPEG buffer. \
* @see {@link jpegAsync} for the async version. \
* @see {@link jpeg} for the sync version. \
*/ \
public jpegAsync(quality?: number): Promise<Buffer> { \
return this.canvas.encode('jpeg', quality); \
Expand Down Expand Up @@ -1896,7 +1896,7 @@ export class Canvas {
* Gets a WebP buffer. \
* @param quality The quality to use, defaults to `80`. \
* @returns A WebP buffer. \
* @see {@link webpAsync} for the async version. \
* @see {@link webp} for the sync version. \
*/ \
public webpAsync(quality?: number): Promise<Buffer> { \
return this.canvas.encode('webp', quality); \
Expand Down Expand Up @@ -1937,7 +1937,7 @@ export class Canvas {
* Gets a PNG buffer. \
* @param config The render configuration. \
* @returns A PNG buffer. \
* @see {@link pngAsync} for the async version. \
* @see {@link png} for the sync version. \
*/ \
public pngAsync(config?: PngConfig): Promise<Buffer> { \
return this.toBufferAsync('image/png', config); \
Expand All @@ -1946,7 +1946,7 @@ export class Canvas {
/** \
* Gets a PNG buffer. \
* @returns A PNG buffer. \
* @see {@link pngAsync} for the async version. \
* @see {@link png} for the sync version. \
*/ \
public pngAsync(): Promise<Buffer> { \
return this.canvas.encode('png'); \
Expand All @@ -1956,6 +1956,7 @@ export class Canvas {
* Gets a PNG buffer. \
* @param options The render options. \
* @returns A PNG buffer. \
* @see {@link png} for the sync version. \
*/ \
public pngAsync(options?: RenderOptions): Promise<Buffer> { \
return this.canvas.toBuffer('png', options); \
Expand Down Expand Up @@ -1997,7 +1998,7 @@ export class Canvas {
* Gets a PDF buffer. \
* @param config The render configuration. \
* @returns A PDF buffer. \
* @see {@link pngAsync} for the async version. \
* @see {@link pdf} for the sync version. \
*/ \
public pdfAsync(config?: PdfConfig): Promise<Buffer> { \
return this.toBufferAsync('application/pdf', config); \
Expand Down Expand Up @@ -2057,7 +2058,7 @@ export class Canvas {
/** \
* Gets an AVIF buffer. \
* @returns A AVIF buffer. \
* @see {@link avifAsync} for the async version. \
* @see {@link avif} for the sync version. \
*/ \
public avifAsync(cfg?: AvifConfig): Promise<Buffer> { \
return this.canvas.encode('avif', cfg); \
Expand Down Expand Up @@ -2356,7 +2357,7 @@ interface ResolvedCircularCoordinates {
sizeY: number;
}

// IF(CAIRO): export { loadImage, NativeImage as Image };
// IF(CAIRO): export { loadImage, loadFont, NativeImage as Image };
// IF(NAPI_RS): export { Path2D, GlobalFonts, NativeImage as Image };
// IF(SKIA): export { Path2D, FontLibrary, NativeImage as Image, loadImage };

Expand Down

0 comments on commit 74d3e81

Please sign in to comment.