@flighthq/bitmapfont 0.3.0-next.1032.e2b99fc → 0.3.0-next.1162.e90e518

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ export function createGlyphSourceFromBitmapFont(font) {
9
9
  // Each page's atlas image, indexed by the glyph's `page`. An out-of-range page (or a page whose
10
10
  // atlas carries no image yet) yields null — the renderer skips glyphs it cannot sample.
11
11
  const texture = font.pages[page]?.texture;
12
- return texture?.storage.dimension === '2d' ? texture.storage.image : null;
12
+ return texture?.dimension === '2d' ? texture.source : null;
13
13
  },
14
14
  getGlyphEntry(codepoint) {
15
15
  return getBitmapFontGlyph(font, codepoint);
@@ -1 +1 @@
1
- {"version":3,"file":"bitmapFontGlyphSource.js","sourceRoot":"","sources":["../src/bitmapFontGlyphSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE9F,sGAAsG;AACtG,mGAAmG;AACnG,0FAA0F;AAC1F,yGAAyG;AACzG,MAAM,UAAU,+BAA+B,CAAC,IAA0B;IACxE,OAAO;QACL,kBAAkB,CAAC,IAAI,GAAG,CAAC;YACzB,gGAAgG;YAChG,wFAAwF;YACxF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;YAC1C,OAAO,OAAO,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5E,CAAC;QACD,aAAa,CAAC,SAAS;YACrB,OAAO,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,eAAe,CAAC,IAAI,EAAE,KAAK;YACzB,OAAO,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,eAAe;YACb,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"bitmapFontGlyphSource.js","sourceRoot":"","sources":["../src/bitmapFontGlyphSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE9F,sGAAsG;AACtG,mGAAmG;AACnG,0FAA0F;AAC1F,yGAAyG;AACzG,MAAM,UAAU,+BAA+B,CAAC,IAA0B;IACxE,OAAO;QACL,kBAAkB,CAAC,IAAI,GAAG,CAAC;YACzB,gGAAgG;YAChG,wFAAwF;YACxF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;YAC1C,OAAO,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7D,CAAC;QACD,aAAa,CAAC,SAAS;YACrB,OAAO,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,eAAe,CAAC,IAAI,EAAE,KAAK;YACzB,OAAO,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,eAAe;YACb,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/bitmapfont",
3
- "version": "0.3.0-next.1032.e2b99fc",
3
+ "version": "0.3.0-next.1162.e90e518",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/flighthq/flight.git",
@@ -36,8 +36,8 @@
36
36
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@flighthq/textureatlas": "0.3.0-next.1032.e2b99fc",
40
- "@flighthq/types": "0.3.0-next.1032.e2b99fc"
39
+ "@flighthq/textureatlas": "0.3.0-next.1162.e90e518",
40
+ "@flighthq/types": "0.3.0-next.1162.e90e518"
41
41
  },
42
42
  "devDependencies": {
43
43
  "typescript": "^5.3.0"
@@ -1,5 +1,5 @@
1
1
  import { createTextureAtlas, createTextureAtlasFromImageResource } from '@flighthq/textureatlas/contract';
2
- import type { BitmapFontData, ImageResource } from '@flighthq/types/contract';
2
+ import type { BitmapFontData, Image } from '@flighthq/types/contract';
3
3
  import { describe, expect, it } from 'vitest';
4
4
 
5
5
  import { createBitmapFont, getBitmapFontGlyph } from './bitmapFont';
@@ -19,7 +19,7 @@ describe('createGlyphSourceFromBitmapFont', () => {
19
19
  });
20
20
 
21
21
  it('pairs page 0 with the font atlas image and has no other page', () => {
22
- const image = {} as ImageResource;
22
+ const image = {} as Image;
23
23
  const font = createBitmapFont({ ...sampleFontData(), pages: [createTextureAtlasFromImageResource(image)] });
24
24
  const source = createGlyphSourceFromBitmapFont(font);
25
25
 
@@ -29,8 +29,8 @@ describe('createGlyphSourceFromBitmapFont', () => {
29
29
  });
30
30
 
31
31
  it('resolves each page image of a multi-page font', () => {
32
- const image0 = {} as ImageResource;
33
- const image1 = {} as ImageResource;
32
+ const image0 = {} as Image;
33
+ const image1 = {} as Image;
34
34
  const font = createBitmapFont({
35
35
  ...sampleFontData(),
36
36
  pages: [createTextureAtlasFromImageResource(image0), createTextureAtlasFromImageResource(image1)],