|
| 1 | +import { Font } from "@react-email/components"; |
| 2 | +import React from "react"; |
| 3 | + |
| 4 | +interface IFont { |
| 5 | + style: React.CSSProperties["fontStyle"]; |
| 6 | + weight: React.CSSProperties["fontWeight"]; |
| 7 | + urls: string[]; |
| 8 | +} |
| 9 | + |
| 10 | +const fonts: IFont[] = [ |
| 11 | + { |
| 12 | + style: "italic", |
| 13 | + weight: 100, |
| 14 | + urls: [ |
| 15 | + "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tDMPKzSQ.woff2", |
| 16 | + "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tMMPKzSQ.woff2", |
| 17 | + "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tCMPI.woff2" |
| 18 | + ] |
| 19 | + }, |
| 20 | + { |
| 21 | + style: "italic", |
| 22 | + weight: 200, |
| 23 | + urls: [ |
| 24 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmv1pVFteOcEg.woff2", |
| 25 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmv1pVGdeOcEg.woff2", |
| 26 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmv1pVF9eO.woff2" |
| 27 | + ] |
| 28 | + }, |
| 29 | + { |
| 30 | + style: "italic", |
| 31 | + weight: 300, |
| 32 | + urls: [ |
| 33 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm21lVFteOcEg.woff2", |
| 34 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm21lVGdeOcEg.woff2", |
| 35 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm21lVF9eO.woff2" |
| 36 | + ] |
| 37 | + }, |
| 38 | + { |
| 39 | + style: "italic", |
| 40 | + weight: 400, |
| 41 | + urls: [ |
| 42 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrJJLucXtAKPY.woff2", |
| 43 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrJJLufntAKPY.woff2", |
| 44 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrJJLucHtA.woff2" |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + style: "italic", |
| 49 | + weight: 500, |
| 50 | + urls: [ |
| 51 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmg1hVFteOcEg.woff2", |
| 52 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmg1hVGdeOcEg.woff2", |
| 53 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmg1hVF9eO.woff2" |
| 54 | + ] |
| 55 | + }, |
| 56 | + { |
| 57 | + style: "italic", |
| 58 | + weight: 600, |
| 59 | + urls: [ |
| 60 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmr19VFteOcEg.woff2", |
| 61 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmr19VGdeOcEg.woff2", |
| 62 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmr19VF9eO.woff2" |
| 63 | + ] |
| 64 | + }, |
| 65 | + { |
| 66 | + style: "italic", |
| 67 | + weight: 700, |
| 68 | + urls: [ |
| 69 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmy15VFteOcEg.woff2", |
| 70 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmy15VGdeOcEg.woff2", |
| 71 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLmy15VF9eO.woff2" |
| 72 | + ] |
| 73 | + }, |
| 74 | + { |
| 75 | + style: "italic", |
| 76 | + weight: 800, |
| 77 | + urls: [ |
| 78 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm111VFteOcEg.woff2", |
| 79 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm111VGdeOcEg.woff2", |
| 80 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm111VF9eO.woff2" |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + style: "italic", |
| 85 | + weight: 900, |
| 86 | + urls: [ |
| 87 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm81xVFteOcEg.woff2", |
| 88 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm81xVGdeOcEg.woff2", |
| 89 | + "https://fonts.gstatic.com/s/poppins/v23/pxiDyp8kv8JHgFVrJJLm81xVF9eO.woff2" |
| 90 | + ] |
| 91 | + }, |
| 92 | + { |
| 93 | + style: "normal", |
| 94 | + weight: 100, |
| 95 | + urls: [ |
| 96 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrLPTucXtAKPY.woff2", |
| 97 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrLPTufntAKPY.woff2", |
| 98 | + "https://fonts.gstatic.com/s/poppins/v23/pxiGyp8kv8JHgFVrLPTucHtA.woff2" |
| 99 | + ] |
| 100 | + }, |
| 101 | + { |
| 102 | + style: "normal", |
| 103 | + weight: 200, |
| 104 | + urls: [ |
| 105 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLFj_Z11lFc-K.woff2", |
| 106 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLFj_Z1JlFc-K.woff2", |
| 107 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLFj_Z1xlFQ.woff2" |
| 108 | + ] |
| 109 | + }, |
| 110 | + { |
| 111 | + style: "normal", |
| 112 | + weight: 300, |
| 113 | + urls: [ |
| 114 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDz8Z11lFc-K.woff2", |
| 115 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDz8Z1JlFc-K.woff2", |
| 116 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2" |
| 117 | + ] |
| 118 | + }, |
| 119 | + { |
| 120 | + style: "normal", |
| 121 | + weight: 400, |
| 122 | + urls: [ |
| 123 | + "https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJbecmNE.woff2", |
| 124 | + "https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJnecmNE.woff2", |
| 125 | + "https://fonts.gstatic.com/s/poppins/v23/pxiEyp8kv8JHgFVrJJfecg.woff2" |
| 126 | + ] |
| 127 | + }, |
| 128 | + { |
| 129 | + style: "normal", |
| 130 | + weight: 500, |
| 131 | + urls: [ |
| 132 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLGT9Z11lFc-K.woff2", |
| 133 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLGT9Z1JlFc-K.woff2", |
| 134 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2" |
| 135 | + ] |
| 136 | + }, |
| 137 | + { |
| 138 | + style: "normal", |
| 139 | + weight: 600, |
| 140 | + urls: [ |
| 141 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLEj6Z11lFc-K.woff2", |
| 142 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLEj6Z1JlFc-K.woff2", |
| 143 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLEj6Z1xlFQ.woff2" |
| 144 | + ] |
| 145 | + }, |
| 146 | + { |
| 147 | + style: "normal", |
| 148 | + weight: 700, |
| 149 | + urls: [ |
| 150 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLCz7Z11lFc-K.woff2", |
| 151 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLCz7Z1JlFc-K.woff2", |
| 152 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLCz7Z1xlFQ.woff2" |
| 153 | + ] |
| 154 | + }, |
| 155 | + { |
| 156 | + style: "normal", |
| 157 | + weight: 800, |
| 158 | + urls: [ |
| 159 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDD4Z11lFc-K.woff2", |
| 160 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDD4Z1JlFc-K.woff2", |
| 161 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLDD4Z1xlFQ.woff2" |
| 162 | + ] |
| 163 | + }, |
| 164 | + { |
| 165 | + style: "normal", |
| 166 | + weight: 900, |
| 167 | + urls: [ |
| 168 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLBT5Z11lFc-K.woff2", |
| 169 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLBT5Z1JlFc-K.woff2", |
| 170 | + "https://fonts.gstatic.com/s/poppins/v23/pxiByp8kv8JHgFVrLBT5Z1xlFQ.woff2" |
| 171 | + ] |
| 172 | + } |
| 173 | +]; |
| 174 | + |
| 175 | +export default function Fonts() { |
| 176 | + const family = "Poppins"; |
| 177 | + const fallback = "serif"; |
| 178 | + return ( |
| 179 | + <> |
| 180 | + {fonts.map((v, i) => |
| 181 | + v.urls.map((url, ui) => ( |
| 182 | + <Font |
| 183 | + key={`${i}-${ui}`} |
| 184 | + fontFamily={family} |
| 185 | + fallbackFontFamily={fallback} |
| 186 | + webFont={{ url, format: "woff2" }} |
| 187 | + fontStyle={v.style} |
| 188 | + fontWeight={v.weight} |
| 189 | + /> |
| 190 | + )) |
| 191 | + )} |
| 192 | + {/* <Font |
| 193 | + fontFamily="Poppins" |
| 194 | + fallbackFontFamily={fallback} |
| 195 | + webFont={{ |
| 196 | + url: "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tDMPKzSQ.woff2", |
| 197 | + format: "woff2" |
| 198 | + }} |
| 199 | + fontStyle="italic" |
| 200 | + fontWeight={100} |
| 201 | + /> |
| 202 | + <Font |
| 203 | + fontFamily="Poppins" |
| 204 | + fallbackFontFamily={fallback} |
| 205 | + webFont={{ |
| 206 | + url: "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tMMPKzSQ.woff2", |
| 207 | + format: "woff2" |
| 208 | + }} |
| 209 | + fontStyle="italic" |
| 210 | + fontWeight={100} |
| 211 | + /> |
| 212 | + <Font |
| 213 | + fontFamily="Poppins" |
| 214 | + fallbackFontFamily={fallback} |
| 215 | + webFont={{ |
| 216 | + url: "https://fonts.gstatic.com/s/poppins/v23/pxiAyp8kv8JHgFVrJJLmE0tCMPI.woff2", |
| 217 | + format: "woff2" |
| 218 | + }} |
| 219 | + fontStyle="italic" |
| 220 | + fontWeight={100} |
| 221 | + /> */} |
| 222 | + </> |
| 223 | + ); |
| 224 | +} |
0 commit comments