react-pdf icon indicating copy to clipboard operation
react-pdf copied to clipboard

Adding Naira symbol "₦" showing "¦"

Open Tnaike opened this issue 1 year ago • 2 comments

Describe the bug I tried adding a naira symbol "₦" but not showing the symbol. Have tried using HTML Entity: (₦) and still didn't get the symbol.

Expected behavior I want to see the Naira symbol (₦). ₦5200. Have tried using HTML Entity: (₦) and still didn't get the symbol.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • OS: Windows
  • Browser [chrome]
  • React-pdf version [3.2.1]

Tnaike avatar Feb 23 '24 00:02 Tnaike

Are you using a font that has that glyph?

diegomura avatar Feb 23 '24 08:02 diegomura

Are you using a font that has that glyph?

@diegomura Yes, I'm using "Roboto".

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

Font.register({
  family: 'Roboto',
  fonts: [
    {
      src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-regular-webfont.ttf',
      fontWeight: 400,
    },
    {
      src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-medium-webfont.ttf',
      fontWeight: 500,
    },
  ],
});

Tnaike avatar Feb 23 '24 12:02 Tnaike

I am facing the same issue, please help

ibmeshach avatar Mar 29 '24 15:03 ibmeshach

Anyone with a solution?

muzardemoses avatar Apr 06 '24 03:04 muzardemoses

Import font as custom file worked for me import font from '../../../fonts/static/Inter-Medium.ttf' Font.register({ family: 'Inter', src: font });

muzardemoses avatar Apr 06 '24 04:04 muzardemoses

Are you sure that Roboto has this character's glyph? @Tnaike

I can't find it in this list: https://github.com/googlefonts/roboto/blob/main/res/glyphlist.txt

MHMighani avatar Apr 11 '24 13:04 MHMighani