from fontTools.ttLib import TTFont

def get_font_full_name(font_path):
    """
    提取字體的完整名稱（Full Name）。
    
    :param font_path: 字體文件的路徑
    :return: 字體的完整名稱
    """
    try:
        font = TTFont(font_path)
        name = ""
        for record in font['name'].names:
            if record.nameID == 4:  # nameID 4 對應於完整名稱
                if b'\x00' in record.string:
                    # 通常是 UTF-16BE 編碼
                    name = record.string.decode('utf-16-be')
                else:
                    name = record.string.decode('utf-8')
                break
        font.close()
        return name
    except Exception as e:
        print(f"無法讀取字體名稱: {e}")
        return None

# 使用範例
font_path = "GenJyuuGothicL-Monospace-Heavy.ttf"  # 替換為您的字體文件路徑
full_name = get_font_full_name(font_path)
if full_name:
    print(f"字體完整名稱: {full_name}")
else:
    print("未能取得字體完整名稱。")
