@weasel-js/core 0.7.0 → 0.7.1

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.
@@ -3,7 +3,7 @@ export { V as ViewLike, v as viewToMat3 } from './viewToMat3-D4lrBigW.js';
3
3
  import { G as GradStop, M as Mat3, S as ShaderProgramHandle, D as DrawCommand, a as Stroke } from './DrawCommand-CJtqqt8H.js';
4
4
  export { b as GroupDrawCommand, I as ImageDrawCommand, P as PathDrawCommand, c as ShaderDrawCommand, d as ShaderUniform, e as SolidPaint, T as TextDrawCommand, m as mat3, r as registerProgram } from './DrawCommand-CJtqqt8H.js';
5
5
  import { P as Path } from './types-B6MMiodD.js';
6
- export { isCanvasFont, registerCanvasFont, registerFont, subscribeGlyphReady, unregisterCanvasFont } from '@weasel-js/font';
6
+ export { canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, subscribeGlyphReady, unregisterCanvasFont, unregisterFontOutlines } from '@weasel-js/font';
7
7
  export { T as TextureHandle, r as registerTexture } from './registerTexture-BzHTLhD9.js';
8
8
 
9
9
  /**
@@ -249,6 +249,14 @@ interface WeaselRendererOptions {
249
249
  * Default DEFAULT_BAKE_BUDGET (16). The headless renderSceneToPixels
250
250
  * path passes Infinity so print never defers a glyph. */
251
251
  bakeBudget?: number;
252
+ /** On-screen glyph size, in CSS pixels, at or above which text renders from
253
+ * tessellated font outlines instead of a distance field — see
254
+ * `OUTLINE_MIN_SCREEN_PX`. Only faces registered with
255
+ * `registerFontOutlines` are affected; everything else keeps its SDF tier
256
+ * whatever this says. Pass `Infinity` to disable the tier outright, or 0
257
+ * to use outlines wherever they exist (what the headless path does, since
258
+ * print has no reason to sample a field it could evaluate exactly). */
259
+ textOutlineMinScreenSize?: number;
252
260
  }
253
261
  declare class WeaselRenderer {
254
262
  private readonly gl;
@@ -277,6 +285,7 @@ declare class WeaselRenderer {
277
285
  private readonly imageMinification;
278
286
  private readonly flattenTolerance?;
279
287
  private readonly bakeBudget;
288
+ private readonly textOutlineMinScreenSize;
280
289
  private contextLost;
281
290
  private boundOnLost;
282
291
  private boundOnRestored;
@@ -374,4 +383,19 @@ interface StrokeOptions {
374
383
  */
375
384
  declare function tessellateStroke(path: Path, stroke: Stroke, opts?: StrokeOptions): Mesh;
376
385
 
377
- export { DrawCommand, IDENTITY_COLOR_MATRIX, ImageMinification, Mat3, type Mesh, ShaderCompileError, ShaderProgramHandle, type StrokeOptions, type TessellateOptions, WeaselRenderer, type WeaselRendererOptions, buildGradientRamp, tessellate, tessellateStroke };
386
+ /**
387
+ * On-screen glyph size (CSS px) at or above which a face with registered
388
+ * outlines is drawn as geometry instead of sampled from a distance field.
389
+ *
390
+ * 48 is the dynamic tier's own `BAKE_SIZE`, which makes it the size at which
391
+ * that tier stops being an interpolation and starts being a magnification:
392
+ * `glyphRasterizer.ts` measures coverage error bottoming out *at* the bake
393
+ * size and rising on both sides, and past a few times it the reconstructed
394
+ * field shows the raster as contour wobble. The same number is a safe
395
+ * crossing for the baked MSDF atlas, which is still crisp here — outlines are
396
+ * exact, so switching early costs nothing but the tessellation, and the
397
+ * hinting the atlas has and outlines don't stopped mattering well below this.
398
+ */
399
+ declare const OUTLINE_MIN_SCREEN_PX = 48;
400
+
401
+ export { DrawCommand, IDENTITY_COLOR_MATRIX, ImageMinification, Mat3, type Mesh, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, ShaderProgramHandle, type StrokeOptions, type TessellateOptions, WeaselRenderer, type WeaselRendererOptions, buildGradientRamp, tessellate, tessellateStroke };
package/dist/renderer.js CHANGED
@@ -1,5 +1,5 @@
1
- export { IDENTITY_COLOR_MATRIX, ShaderCompileError, WeaselRenderer, buildGradientRamp, isCanvasFont, mat3, registerCanvasFont, registerFont, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, viewToMat3 } from './chunk-7F3SDUJ4.js';
2
- import './chunk-FSZEXVCR.js';
1
+ export { IDENTITY_COLOR_MATRIX, OUTLINE_MIN_SCREEN_PX, ShaderCompileError, WeaselRenderer, buildGradientRamp, canQueryLocalFonts, enableLocalFontOutlines, hasFontOutlines, isCanvasFont, listFontOutlines, mat3, outlineStatus, registerCanvasFont, registerFont, registerFontOutlines, registerProgram, subscribeGlyphReady, tessellate, tessellateStroke, unregisterCanvasFont, unregisterFontOutlines, viewToMat3 } from './chunk-2J6V527H.js';
2
+ import './chunk-SYM6RAM4.js';
3
3
  import './chunk-VOVKONXA.js';
4
4
  import './chunk-BGGZ4CVF.js';
5
5
  import './chunk-CQNKCG34.js';
package/dist/routing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { aW as Conflict, aX as PREDICATE_TARGET, aY as RegistryEntry, aZ as ToolDef, k as ToolKeybinding, a_ as ViewportToolDef, a$ as buildRouteRegistry, b0 as defineTool, b1 as defineViewportTool, b2 as findConflicts } from './index-D31EADQG.js';
1
+ export { aX as Conflict, aY as PREDICATE_TARGET, aZ as RegistryEntry, a_ as ToolDef, k as ToolKeybinding, a$ as ToolScopes, b0 as ViewportToolDef, b1 as buildRouteRegistry, b2 as defineTool, b3 as defineViewportTool, b4 as findConflicts, b5 as findScopedConflicts, b6 as formatConflict, b7 as reportRouteConflicts } from './index-DOYRTfP0.js';
2
2
  export { ChannelRef, DescribeRouteOptions, GESTURE_DESCRIPTORS, GestureArgSpec, GestureDescriptor, GestureName, ModRequirement, ModifierKey, ParsedModifiers, ParsedRoute, PhaseAtom, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, RouteDescriptionPart, RouteFieldName, RouteTermLabel, canonicalModifiers, collapseShiftPairs, describeRoute, describeRouteParts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from '@weasel-js/gestures';
3
3
  import './types-Cpb4hii1.js';
4
4
  import '@weasel-js/history';
package/dist/routing.js CHANGED
@@ -1,4 +1,4 @@
1
- export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, defineTool, defineViewportTool, describeRoute, describeRouteParts, findConflicts, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute } from './chunk-FSZEXVCR.js';
1
+ export { GESTURE_DESCRIPTORS, PREDICATE_TARGET, RESERVED_ID_NAMES, RESERVED_ID_PREFIXES, ROUTE_FIELD_DEFINITIONS, ROUTE_TERMS, buildRouteRegistry, canonicalModifiers, collapseShiftPairs, defineTool, defineViewportTool, describeRoute, describeRouteParts, findConflicts, findScopedConflicts, formatConflict, formatPhaseAtom, formatRoute, getGestureDescriptor, isKnownGestureName, parseRoute, reportRouteConflicts } from './chunk-SYM6RAM4.js';
2
2
  import './chunk-PZ5AY32C.js';
3
3
  //# sourceMappingURL=routing.js.map
4
4
  //# sourceMappingURL=routing.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasel-js/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Domain-agnostic 2D scene graph primitives for React: viewport math, drag/resize/insert/clone interactions, layered canvas rendering.",
5
5
  "license": "MIT",
6
6
  "author": "orochi235",
@@ -70,11 +70,11 @@
70
70
  "react": ">=18"
71
71
  },
72
72
  "dependencies": {
73
- "@weasel-js/font": "0.7.0",
74
- "@weasel-js/geom": "0.7.0",
75
- "@weasel-js/gestures": "0.7.0",
76
- "@weasel-js/history": "0.7.0",
77
- "@weasel-js/modes": "0.7.0",
73
+ "@weasel-js/font": "0.7.1",
74
+ "@weasel-js/geom": "0.7.1",
75
+ "@weasel-js/gestures": "0.7.1",
76
+ "@weasel-js/history": "0.7.1",
77
+ "@weasel-js/modes": "0.7.1",
78
78
  "earcut": "2.2.4",
79
79
  "polygon-clipping": "^0.15.7"
80
80
  },