Skip to content

Commit

Permalink
fix(pdf): rollback to helvetica
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Nov 15, 2024
1 parent a356145 commit 1086abe
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/electric-client/src/generated/typebox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export * from './pdf_snapshotInput';
export * from './pictures';
export * from './picturesInput';
export * from './tmp_pictures';
export * from './picture_lines';
export * from './tmp_picturesInput';
export * from './picture_lines';
export * from './picture_linesInput';
68 changes: 42 additions & 26 deletions packages/pdf/src/report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ import type { Udap, Report, Service_instructeurs, Clause_v2, Pictures } from "@c
import { Buffer } from "buffer";

export const initFonts = (folder: string = "") => {
Font.register({
family: "Marianne",
fonts: [
{
src: `${folder}/fonts/Marianne-Regular.ttf`,
fontStyle: "normal",
fontWeight: "normal",
},
{ src: `${folder}/fonts/Marianne-Bold.ttf`, fontStyle: "normal", fontWeight: "bold" },
{
src: `${folder}/fonts/Marianne-RegularItalic.ttf`,
fontStyle: "italic",
fontWeight: "normal",
},
{
src: `${folder}/fonts/Marianne-BoldItalic.ttf`,
fontStyle: "italic",
fontWeight: "bold",
},
],
});
// Font.register({
// family: "Marianne",
// fonts: [
// {
// src: `${folder}/fonts/Marianne-Regular.ttf`,
// fontStyle: "normal",
// fontWeight: "normal",
// },
// { src: `${folder}/fonts/Marianne-Bold.ttf`, fontStyle: "normal", fontWeight: "bold" },
// {
// src: `${folder}/fonts/Marianne-RegularItalic.ttf`,
// fontStyle: "italic",
// fontWeight: "normal",
// },
// {
// src: `${folder}/fonts/Marianne-BoldItalic.ttf`,
// fontStyle: "italic",
// fontWeight: "bold",
// },
// ],
// });
};

Font.registerHyphenationCallback((word) => {
Expand Down Expand Up @@ -57,15 +57,31 @@ export const ReportPDFDocument = ({ udap, htmlString, images, pictures }: Report
<body>
<style>
body {
font-family: Marianne;
font-family: Helvetica;
}
strong {
font-weight: bold;
font-family: Helvetica-Bold;
}
em {
font-style: italic;
font-family: Helvetica-Oblique;
}
strong em span {
font-family: Helvetica-BoldOblique;
}
em strong span {
font-family: Helvetica-BoldOblique;
}
strong em {
font-family: Helvetica-BoldOblique;
}
em strong {
font-family: Helvetica-BoldOblique;
}
.marianne-img {
Expand Down Expand Up @@ -111,7 +127,7 @@ export const ReportPDFDocument = ({ udap, htmlString, images, pictures }: Report
.right-texts > div {
text-align: right;
font-size: 14px;
font-weight: bold;
font-family: Helvetica-Bold;
}
.meeting-date {
Expand Down

0 comments on commit 1086abe

Please sign in to comment.