how to add a new font or style?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
Start by reading pdffont.js around _stdFonts, _kFontFaces, and _kFontStyles to understand how the existing font faces and styles are represented. The issue names no tests, entry point beyond these arrays, or acceptance condition, so confirm the supported approach and expected result with maintainers before making a change.
Written by the indexing model from the issue text.
Description
I'm having problems with fonts in the pdffont.js file.
The font I need to add is times new roman. I couldn't add it and in the main sources I didn't find any serif
`
let _stdFonts = ["arial", "helvetica", "sans-serif ", "courier ", "monospace ", "ocr "];
let _kFontFaces = [
"quicktype,arial,helvetica,sans-serif", // 00 - QuickType - sans-serif variable font
"quicktype condensed,arial narrow,arial,helvetica,sans-serif", // 01 - QuickType Condensed - thin sans-serif variable font
"quicktypepi,quicktypeiipi", // 02 - QuickType Pi
"quicktype mono,courier new,courier,monospace", // 03 - QuickType Mono - san-serif fixed font
"ocr-a,courier new,courier,monospace", // 04 - OCR-A - OCR readable san-serif fixed font
"ocr b mt,courier new,courier,monospace" // 05 - OCR-B MT - OCR readable san-serif fixed font
];
let _kFontStyles = [
// Face Size Bold Italic StyleID(Comment)
// ----- ---- ---- ----- -----------------
[0, 6, 0, 0], //00
[0, 8, 0, 0], //01
[0, 10, 0, 0], //02
[0, 12, 0, 0], //03
[0, 14, 0, 0], //04
[0, 18, 0, 0], //05
[0, 6, 1, 0], //06
[0, 8, 1, 0], //07
[0, 10, 1, 0], //08
[0, 12, 1, 0], //09
[0, 14, 1, 0], //10
[0, 18, 1, 0], //11
[0, 6, 0, 1], //12
[0, 8, 0, 1], //13
[0, 10, 0, 1], //14
[0, 12, 0, 1], //15
[0, 14, 0, 1], //16
[0, 18, 0, 1], //17
[0, 6, 1, 1], //18
[0, 8, 1, 1], //19
[0, 10, 1, 1], //20
[0, 12, 1, 1], //21
[0, 14, 1, 1], //22
[0, 18, 1, 1], //23
[1, 6, 0, 0], //24
[1, 8, 0, 0], //25
[1, 10, 0, 0], //26
[1, 12, 0, 0], //27
[1, 14, 0, 0], //28
[1, 18, 0, 0], //29
[1, 6, 1, 0], //30
[1, 8, 1, 0], //31
[1, 10, 1, 0], //32
[1, 12, 1, 0], //33
[1, 14, 1, 0], //34
[1, 18, 1, 0], //35
[1, 6, 0, 1], //36
[1, 8, 0, 1], //37
[1, 10, 0, 1], //38
[1, 12, 0, 1], //39
[1, 14, 0, 1], //40
[1, 18, 0, 1], //41
[2, 8, 0, 0], //42
[2, 10, 0, 0], //43
[2, 12, 0, 0], //44
[2, 14, 0, 0], //45
[2, 18, 0, 0], //46
[3, 8, 0, 0], //47
[3, 10, 0, 0], //48
[3, 12, 0, 0], //49
[4, 12, 0, 0], //50
[0, 9, 0, 0], //51
[0, 9, 1, 0], //52
[0, 9, 0, 1], //53
[0, 9, 1, 1], //54
[1, 9, 0, 0], //55
[1, 9, 1, 0], //56
[1, 9, 1, 1], //57
[4, 10, 0, 0], //58
[5, 10, 0, 0], //59
[5, 12, 0, 0] //60
];
`Is this where I add? Like?
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 396
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modesty/pdf2json
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3Open
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
`getRawTextContent` does not returns words' pieces in proper coordinate orderPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in modesty/pdf2json
Similar issues
-
Area-UIUX Issue-Bug Issue-Easy (good first issue)
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
TeamAmaze/AmazeFileManager#4769 ·
Maintainers usually reply within 7 days
-
Expose SManga.memo & SChapter.memo fields in GraphQL APIs to support source-specific client featuresOpenenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Suwayomi/Suwayomi-Server#2551 ·
Maintainers usually reply within 9 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ShaftHQ/SHAFT_ENGINE#7861 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
MetricsHub/metricshub-community#1532 ·
Maintainers usually reply within 1 day