Skip to main content

A tool library for generating mapping dictionaries based on font files

Project description

⭐️ 简介

本库是一个基于 python 的工具集,用于生成字体文件字典映射。

✨️ 理念

简单,可靠,省心。

📕 背景

进行数据采集的时候,常常会遇到字体反爬,常用的解决办法是通过获取字体字形映射关系替换文本解决,但生成或者说是获取字体映射关系的方法不是很常见,所以写了这个库,方便生成获取

🌠 用法

这里介绍工具用法。

安装

pip install FontMap

使用

导包

import FontMap

实例化

fontmap = FontMap.HuiFontMap(fontpath='字体文件路径',savepath='生成的字形图片保存路径',issaveimg='是否保存图片')

执行会根据传入的路径生成并保存字形文件

方法

目前只使用了ddddocr识别,测试大部分是没有问题基本,一小部分的化可能会存在识别精度的问题

fontmap.ocrFontImg(jsonpath='识别结果的保存路径')

此方法返回执行的结果,类型为字典,默认是不保存识别结果的

👨‍💻 更新

优化了图片生成速度和ddddocr识别精度

最后 如果本项目有问题,欢迎反馈,QQ:2176189493

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

FontMap-1.1.6.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FontMap-1.1.6-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file FontMap-1.1.6.tar.gz.

File metadata

  • Download URL: FontMap-1.1.6.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for FontMap-1.1.6.tar.gz
Algorithm Hash digest
SHA256 6c084016fe7371301ccd9a2c48735855eb6b890054fa8772041e0649b8094c71
MD5 814028dd1d7bd1531e971dd1efb5f542
BLAKE2b-256 acf9a6ebe65c3f866a5f5da9a315cd9c24e3f6f93b61c447033e9130acceb676

See more details on using hashes here.

File details

Details for the file FontMap-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: FontMap-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for FontMap-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c59ac37fea1f0c5e13e8f162d6e3fe762e7aaffd4246cb21e3cad24f406604b2
MD5 9deb905be820487cd23ca1bbf0ff1ac6
BLAKE2b-256 5d7d8a631f9f0b832677355e11a3927e85f5c9d7191c06ff1594458cb1cf60d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page