Skip to content

FT_Exception: (cannot open resource) - non-english file path #157

@moi15moi

Description

@moi15moi

freetype.Face() seems to not take non-ascii path. It will raise an exception.

With a string path

import freetype
font = freetype.Face(r"C:\Windows\Fonts\حُرّ عادي.ttf") # it return: freetype.ft_errors.FT_Exception: FT_Exception:  (cannot open resource)

With an BufferedReader

from pathlib import Path
import freetype
font = freetype.Face(Path(r"C:\Windows\Fonts\حُرّ عادي.ttf").open("rb")) # Works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions