Skip to content

Instantly share code, notes, and snippets.

Pokete において罫線表示が崩れる問題を修正する

概要

[Pokete][POKE] とは、人気ゲームポケモンライクのテキストベースゲームです。ここで、 [Pokete][POKE] を日本語環境で起動すると、罫線等の文字幅を適切に扱うことが出来ず、画面が崩れる不具合が発生します。

これは、 Unicode の規格における東アジア圏の各種文字のうち、いわゆる罫線文字及び "■" 等、 [East_Asian_Width 特性の値が A (Ambiguous) となる文字][EAWA] (以下、 [East Asian Ambiguous Character][EAWA]) が、日本語環境で文字幅を適切に扱うことが出来ない事が原因と考えられます。

この問題は、 [Pokete][POKE] のソースコードのうち、 pokete_classes/ui_elements.py 及び pokete_classes/input.py において、罫線文字及び "■" 文字を代替となる ASCII 文字に置き換えることで解決することが出来ます。

@tinywrkb
tinywrkb / btswitch
Last active February 6, 2024 10:09
NOT NEEDED WITH 0.3.21 OR GIT VERSION | PipeWire Pulse Server Bluetooth Auto-Switch
#!/bin/bash
#
# ~/.local/bin/btswitch
#
# wait a second this is too fast for udev
sleep 1
btdev="$(pactl list sinks|grep Name|grep 'bluez.*.a2dp.sink'|sed 's/Name: //'|sed 's/\s//')"
if [ -n "$btdev" ]; then
@fnky
fnky / ANSI.md
Last active June 21, 2024 03:15
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@dvirsky
dvirsky / gendocs.py
Last active September 12, 2021 16:12
Generate Markdown documentation from a python package
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"