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

allow to load .ttc fonts #1223

Closed
Anteru opened this issue Aug 31, 2019 · 1 comment
Closed

allow to load .ttc fonts #1223

Anteru opened this issue Aug 31, 2019 · 1 comment
Labels
A-formatting area: changes to formatters S-minor severity: minor T-feature type: a new feature X-imported imported from Bitbucket
Milestone

Comments

@Anteru
Copy link
Collaborator

Anteru commented Aug 31, 2019

(Original issue 1519 created by vanyakosmos on 2019-06-01T18:04:00.912951+00:00)

formatter.img:123

instead of loading just ttf:

def _create_mac(self):
    font_map = {}
    for font_dir in (os.path.join(os.getenv('HOME'), 'Library/Fonts/'),
                      '/Library/Fonts/', '/System/Library/Fonts/'):
        font_map.update(
            ((os.path.splitext(f)[0].lower(), os.path.join(font_dir, f))
                for f in os.listdir(font_dir) if f.lower().endswith('ttf')))

check multiple extensions:

def _create_mac(self):
    font_map = {}
    for font_dir in (
        os.path.join(os.getenv('HOME'), 'Library/Fonts/'),
        '/Library/Fonts/', 
        '/System/Library/Fonts/',
    ):
        font_map.update(
            (os.path.splitext(f)[0].lower(), os.path.join(font_dir, f))
            for f in os.listdir(font_dir)
            if f.lower().endswith(('ttf', 'ttc'))
        )
@Anteru Anteru added T-feature type: a new feature X-imported imported from Bitbucket S-minor severity: minor labels Aug 31, 2019
@birkenfeld birkenfeld added the A-formatting area: changes to formatters label Nov 25, 2019
@zshimanchik
Copy link

up. still actual

Kenny2github pushed a commit to Kenny2github/pygments that referenced this issue Sep 22, 2020
@Anteru Anteru added this to the 2.7.2 milestone Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-formatting area: changes to formatters S-minor severity: minor T-feature type: a new feature X-imported imported from Bitbucket
Projects
None yet
Development

No branches or pull requests

3 participants