|

楼主 |
发表于 2013-2-15 22:41:17
|
显示全部楼层
本帖最后由 zhyk 于 2013-2-15 22:46 编辑
Proton 发表于 2013-2-15 22:08 
1、BGM音量调整
在不大幅调整 UI 的情况下,可以通过聊天框指令作为替代方案。
好主意
要不复制我来搞定?
pygelt只要修正wrap就可以了
PATCH:
pyglet/text/layout.py- 1106a1107,1108
- > from unicodedata import category as unicat
- >
- 1118c1120
- < if text in u'\u0020\u200b\t':
- ---
- > if text in u'\u0020\u200b\t' or unicat(text) == 'Zs':
- 1157,1159c1159,1173
- < new_paragraph = text in u'\n\u2029'
- < new_line = (text == u'\u2028') or new_paragraph
- < if (wrap and x + kern + glyph.advance >= width) or new_line:
- ---
- > new_paragraph = text == '\n' or unicat(text) == 'Zp'
- > new_line = unicat(text) == 'Zl' or new_paragraph
- > if unicat(text) == 'Lo':
- > for run in run_accum:
- > line.add_box(run)
- > run_accum = []
- > run_accum_width = 0
- > owner_accum_commit.extend(owner_accum)
- > owner_accum_commit_width += owner_accum_width
- > eol_ws = 0
- > owner_accum = []
- > owner_accum_width = 0
- > next_start = index
- >
- > if (wrap and x + kern + glyph.advance > width) or new_line:
- 1248a1263
- >
- 1251a1267,1278
- > if unicat(text) == 'Lo':
- > for run in run_accum:
- > line.add_box(run)
- > run_accum = []
- > run_accum_width = 0
- > owner_accum_commit.extend(owner_accum)
- > owner_accum_commit_width += owner_accum_width
- > eol_ws = 0
- > owner_accum = []
- > owner_accum_width = 0
- > next_start = index
- >
复制代码 |
|