相关疑难解决方法(0)

Unicode“关于成对括号字符语义的讨论”在哪里?

Unicode基本拉丁语 (ASCII) 代码表具有以下括号代码点条目:

\n\n
0028  (  LEFT PARENTHESIS\n         = opening parenthesis (1.0)\n\n0029  )  RIGHT PARENTHESIS\n         = closing parenthesis (1.0)\n         \xe2\x80\xa2 see discussion on semantics of paired\n         bracketing characters\n
Run Code Online (Sandbox Code Playgroud)\n\n

据我所知,该文档没有进一步说明它指的是哪个“配对括号字符语义的讨论”。我猜这是关于“左”/“右”与“打开”/“关闭”,但我想了解更多。

\n\n

当我在网上搜索诸如“成对括号字符的语义”之类的短语时,我只得到不同版本的相同文档。

\n\n

它指的是哪些讨论?我在哪里可以阅读它?

\n

unicode ascii utf-8 parentheses semantics

5
推荐指数
0
解决办法
147
查看次数

在Python中测试一个字形是否是同一字体中另一个字形的反映

灵感来自所有unicode的开/关括号的列表?我正在尝试找到给定字体中彼此反射的所有unicode字形的列表.首先,我只需要能够测试一个字形是否是另一个字形的反射.下面我有两个不同的尝试(我的render_char函数的两个不同的实现),但我无法使用任何一个识别'('和')'作为镜像.我怎样才能做到这一点?

from PIL import Image,ImageDraw,ImageFont
import freetype
import numpy as np

def render_char0(c):
    # Based on https://github.com/rougier/freetype-py/blob/master/examples/hello-world.py
    # Needs numpy (blech) and the image comes out the inverse of the way I expect
    face = freetype.Face("/Library/Fonts/Verdana.ttf")
    face.set_char_size( 48*64 )
    face.load_char(c)
    bitmap = face.glyph.bitmap
    w,h = bitmap.width, bitmap.rows
    Z = np.array(bitmap.buffer, dtype=np.ubyte).reshape(h,w)
    return Image.fromarray(Z, mode='L').convert('1')

def render_char1(c):
    # Based on https://stackoverflow.com/a/14446201/2829764
    verdana_font = ImageFont.truetype("/Library/Fonts/Verdana.ttf", 20, encoding="unic")
    text_width, text_height = verdana_font.getsize(c)
    canvas = Image.new('RGB', (text_width+10, text_height+10), (255, 255, …
Run Code Online (Sandbox Code Playgroud)

python fonts glyph python-imaging-library

0
推荐指数
1
解决办法
159
查看次数