Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: user defined path to font was ignored in add_font when `uni=True #29

Closed
wants to merge 1 commit into from
Closed

Fix: user defined path to font was ignored in add_font when `uni=True #29

wants to merge 1 commit into from

Conversation

Lucas-C
Copy link
Member

@Lucas-C Lucas-C commented Jan 6, 2021

Copied from reingart#167

Thanks @xitrushiy!

@alexanderankin
Copy link

looks like it was fixed in 2f55ab2

@Lucas-C
Copy link
Member Author

Lucas-C commented Jan 6, 2021

Indeed! Sorry, I thought there were 2 distinct dicts :)
Closing this as it is already fixed!

@Lucas-C Lucas-C closed this Jan 6, 2021
@alexanderankin
Copy link

looks like it got overwritten or i never merged it right in the first place???

@alexanderankin alexanderankin reopened this Jan 6, 2021
@Lucas-C
Copy link
Member Author

Lucas-C commented Jan 6, 2021

No you did! :)
You fixed the font_dict dictionnary directly, a few lines above.
So this is not an issue anymore, and this PR brings nothing new, that's why I closed it.

@Lucas-C Lucas-C closed this Jan 6, 2021
@alexanderankin
Copy link

alexanderankin commented Jan 6, 2021

edit: okay!

$ git checkout 98ea55c5
HEAD is now at 98ea55c Auto-format code with black
$ git blame fpdf/fpdf.py -L 645,655
4dbbe52d fpdf.py      (Mariano Reingart 2012-06-16 22:26:22 -0300 645)                 font_dict = {
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 646)                     "name": re.sub("[ ()]", "", ttf.fullName),
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 647)                     "type": "TTF",
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 648)                     "desc": desc,
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 649)                     "up": round(ttf.underlinePosition),
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 650)                     "ut": round(ttf.underlineThickness),
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 651)                     "ttffile": ttffilename,
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 652)                     "fontkey": fontkey,
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 653)                     "originalsize": os.stat(ttffilename).st_size,
98ea55c5 fpdf/fpdf.py (Lucas Cimon      2021-01-03 11:48:53 +0100 654)                     "cw": ttf.charWidths,
bd608e48 fpdf/fpdf.py (Dave Ankin       2017-03-16 09:26:17 -0400 655)                 }
$ git checkout HEAD^
Previous HEAD position was 98ea55c Auto-format code with black
HEAD is now at 196bbc7 Getting rid of six & py3k module now that we only support Python 3
$ git blame fpdf/fpdf.py -L 625,635
bd608e48 fpdf/fpdf.py (Dave Ankin       2017-03-16 09:26:17 -0400 625)                 'up'          : font_dict['up'],
bd608e48 fpdf/fpdf.py (Dave Ankin       2017-03-16 09:26:17 -0400 626)                 'ut'          : font_dict['ut'],
bd608e48 fpdf/fpdf.py (Dave Ankin       2017-03-16 09:26:17 -0400 627)                 'cw'          : font_dict['cw'],
bd608e48 fpdf/fpdf.py (Dave Ankin       2017-03-16 09:26:17 -0400 628)                 'ttffile'     : font_dict['ttffile'],

@Lucas-C Lucas-C deleted the xitrushiy-reingart-167 branch January 8, 2021 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants