Skip to content

Helvetica font not embedded even if i registered #3250

@MariuzM

Description

@MariuzM

Checking with Adobe Pro > Use Print Production > Preflight i always get error message that Helvetica is not embedded even tho i have it registered

Here is example code

Image
import { Document, Font, Page, PDFViewer, StyleSheet, Text } from '@react-pdf/renderer'

const PAGE_WIDTH = 6.25 * 72
const PAGE_HEIGHT = 9.25 * 72
const PAGE_PADDING = 40

Font.register({
  family: 'Helvetica',
  src: '/fonts/Helvetica.ttf',
})

export const BookPdfV3 = () => {
  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <PDFViewer style={{ width: '100%', height: '100%' }}>
        <Document>
          <Page size={[PAGE_WIDTH, PAGE_HEIGHT]} style={CSS.page}>
            <Text style={{ fontFamily: 'Helvetica' }}>Test</Text>
          </Page>
        </Document>
      </PDFViewer>
    </div>
  )
}

const CSS = StyleSheet.create({
  page: {
    padding: PAGE_PADDING,
    fontSize: 12,
    fontFamily: 'Helvetica',
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions