Skip to content

Commit

Permalink
Pdf font issue (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo authored Mar 7, 2024
1 parent 9df4b7c commit 032ca78
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
8 changes: 4 additions & 4 deletions web/components/pdfs/ApplicationDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import ApplicationReference from '~components/pdfs/ApplicationReference'
import { BRAND_COLOR, styles } from '~components/pdfs/pdfStyleUtils'
import { Application } from '~typings/api'

const Mabry = require('./../../public/assets/fonts/mabry-pro.otf')
const MabryMedium = require('./../../public/assets/fonts/mabry-pro-medium.otf')
// const Mabry = require('./../../public/assets/fonts/mabry-pro.otf')
// const MabryMedium = require('./../../public/assets/fonts/mabry-pro-medium.otf')

Font.register({ family: 'Mabry', src: Mabry.default })
Font.register({ family: 'MabryMedium', src: MabryMedium.default })
// Font.register({ family: 'Mabry', src: Mabry.default })
// Font.register({ family: 'MabryMedium', src: MabryMedium.default })

const ApplicationDocument = ({ application }: { application: Application }) => {
const creations = application?.references as any[]
Expand Down
2 changes: 1 addition & 1 deletion web/components/pdfs/ApplicationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ApplicationHeader = ({ application }: { application: Application }) => {
<Text
style={{
fontSize: FONT_SIZE_BIG,
fontFamily: 'MabryMedium',
// fontFamily: 'MabryMedium',
marginBottom: 10,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion web/components/pdfs/ApplicationReference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ApplicationReference = ({
>
<Text style={{ color: BRAND_COLOR }}>Création {index + 1}</Text>
<Text
style={{ fontFamily: 'MabryMedium' }}
// style={{ fontFamily: 'MabryMedium' }}
>{`${reference?.title}, ${reference?.year}`}</Text>
<Text>
{`${reference?.actors} ${
Expand Down
9 changes: 8 additions & 1 deletion web/components/pdfs/ApplicationSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ const ApplicationSection = ({
paddingVertical: 12,
}}
>
<Text style={{ marginBottom: 6, fontFamily: 'MabryMedium' }}>{label}</Text>
<Text
style={{
marginBottom: 6,
// fontFamily: 'MabryMedium'
}}
>
{label}
</Text>
<Text> {children}</Text>
</View>
)
Expand Down
8 changes: 4 additions & 4 deletions web/components/pdfs/DividerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Document, Font, Page, Text } from '@react-pdf/renderer'
import { styles } from '~components/pdfs/pdfStyleUtils'
import { Campaign, UsersPermissionsUser } from '~typings/api'

const Mabry = require('./../../public/assets/fonts/mabry-pro.otf')
const MabryMedium = require('./../../public/assets/fonts/mabry-pro-medium.otf')
// const Mabry = require('./../../public/assets/fonts/mabry-pro.otf')
// const MabryMedium = require('./../../public/assets/fonts/mabry-pro-medium.otf')

Font.register({ family: 'Mabry', src: Mabry.default })
Font.register({ family: 'MabryMedium', src: MabryMedium.default })
// Font.register({ family: 'Mabry', src: Mabry.default })
// Font.register({ family: 'MabryMedium', src: MabryMedium.default })

const DividerPage = ({
place,
Expand Down
2 changes: 1 addition & 1 deletion web/components/pdfs/pdfStyleUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const FONT_SIZE_BIG = 14

export const styles = StyleSheet.create({
page: {
fontFamily: 'Mabry',
// fontFamily: 'Mabry',
padding: 20,
},
title: {
Expand Down

0 comments on commit 032ca78

Please sign in to comment.