Skip to content

Commit

Permalink
Fix font rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
spaaaacccee committed May 11, 2024
1 parent 8aea00c commit 2c631a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions client/src/hooks/usePlaybackState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export function usePlaybackState(key?: string) {
canStepBackward: ready && !playing && step > 0,
};

console.log(layer);

const pause = (n = 0) => {
// notify("Playback paused");
setPlaybackState({ playback: "paused", step: stepBy(n) });
Expand Down
1 change: 0 additions & 1 deletion client/src/layers/trace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export const controller = {
});
useEffect(() => {
produce((l) => {
console.log(trace?.content?.events?.length);
return set(l, "source.playbackTo", trace?.content?.events?.length ?? 0);
});
}, [trace?.key, trace?.lastModified]);
Expand Down
12 changes: 12 additions & 0 deletions internal-renderers/src/d2-renderer/D2RendererWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,19 @@ export class D2RendererWorker extends EventEmitter<
this.#getRenderQueue()();
}

loadFont = once(async () => {
const fontFace = new FontFace(
"Inter",
"local('Inter'), local('Inter UI'), url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2')"
);
// add it to the list of fonts our worker supports
self.fonts.add(fontFace);
// load the font
await fontFace.load();
});

async render() {
await this.loadFont();
for (const { tile, bounds } of getTiles(
this.#frustum,
this.#options.tileSubdivision
Expand Down

0 comments on commit 2c631a1

Please sign in to comment.