Skip to content

Commit

Permalink
refactor frontend public resources
Browse files Browse the repository at this point in the history
  • Loading branch information
morbalint committed Mar 3, 2024
1 parent 34eaa3d commit 0f24f19
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Kemkas.Web/frontend/src/first-edition/pdf/character.pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ function DrawFelszereles(draw: (text: string, x: number, y:number) => void, fels

export async function CreatePDF(karakter: KarakterPdfView) {

const existingPdfBytes = await fetch('/km_karakterlap_hysteria_1.2.pdf').then(res => res.arrayBuffer())
const existingPdfBytes = await fetch('/pdfs/km_karakterlap_hysteria_1.2.pdf').then(res => res.arrayBuffer())
const pdfDoc = await PDFDocument.load(existingPdfBytes)
pdfDoc.registerFontkit(fontkit)

const fontBytes = await fetch('/Merienda-Regular.ttf').then(res => res.arrayBuffer())
const fontBytes = await fetch('/fonts/Merienda-Regular.ttf').then(res => res.arrayBuffer())
const pdfFont = await pdfDoc.embedFont(fontBytes)
const fontSizeBase = 12

Expand Down Expand Up @@ -79,7 +79,7 @@ export async function CreatePDF(karakter: KarakterPdfView) {
DrawMagic(page, fontSizeBase, pdfFont, karakter.NapiMemorizalhatoVarazslatok, karakter.VarazslatMentokNF)

const secondPage = pdfDoc.addPage()
const fontBoldBytes = await fetch('/Merienda-Bold.ttf').then(res => res.arrayBuffer())
const fontBoldBytes = await fetch('/fonts/Merienda-Bold.ttf').then(res => res.arrayBuffer())
const fontBold = await pdfDoc.embedFont(fontBoldBytes)
DrawOsztalySpecialsPage(secondPage, pdfFont, fontBold, karakter)

Expand Down
4 changes: 2 additions & 2 deletions Kemkas.Web/frontend/src/second-edition/pdf/character.pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import download from "downloadjs";
import {SignedNumberToText} from "../../shared/components/Helpers";

export async function CreatePDF(karakter: KarakterPdfView) {
const existingPdfBytes = await fetch('/kem2karakterlap_form.pdf').then(res => res.arrayBuffer())
const existingPdfBytes = await fetch('/pdfs/kem2karakterlap_form.pdf').then(res => res.arrayBuffer())
const pdfDoc = await PDFDocument.load(existingPdfBytes)
pdfDoc.registerFontkit(fontkit)

const fontBytes = await fetch('/Milonga-Regular.ttf').then(res => res.arrayBuffer())
const fontBytes = await fetch('/fonts/Milonga-Regular.ttf').then(res => res.arrayBuffer())
const pdfFont = await pdfDoc.embedFont(fontBytes)

const form = pdfDoc.getForm()
Expand Down

0 comments on commit 0f24f19

Please sign in to comment.