Comments (6)
遗憾的是cmd目前不能通过自动化方式修改控制台字体(至少我没找到),大部分中文版Windows应该都是开箱即用的(JVM版请根据README.md设置java参数,Native版不应该出现此问题)。
GUI和WebUI已经提上日程了,可以关注一下,后续看看能不能把控制台的内容在GUI/WebUI里面显示。
from peerbanhelper.
遗憾,我用的就是最新的懒人版……
据说可以通过 C++ 来调用 Windows API 的
SetCurrentConsoleFontEx
来达到目的。
另外据我自己的了解,只要对某一路径的程序启动的 CMD 窗口修改过属性,它就会在注册表上留下永久的信息。下次再次通过同样路径的程序打开的 CMD 窗口会复用该设置,属于一劳永逸。
也许可以考虑在启动时检查当前窗口所用的字体是否为指定的字体,如否,则尝试调用管理员权限写入注册表信息来修改字体,接着再启动(或重启?)本体。
大概……能方便一些小白或懒狗用户吧😂
举个栗子
:: 设置字体名称
set FontName=NSimsun
:: 获取当前字体设置
for /f "tokens=*" %%a in ('reg query "HKEY_CURRENT_USER\Console\%当前运行路径%_peerbanhelper-binary.exe" /v FaceName ^| find /i "FaceName"') do set CurrentFont=%%a
:: 判断
if CurrentFont=FontName
……
后面的你懂的……
from peerbanhelper.
对注册表操作远远超过了 PBH 该做的事情。作为一个小工具操作系统级注册表实在是有些越界了。
Java 确实可以调用 C++ API,但相当麻烦。我和群友测试下没有出现字体问题,因此没有计划对此单独修正(除非有更多的人出现相同问题)。可以考虑通过日志文件查看控制台日志,或者WebUI获取信息。
from peerbanhelper.
其实…… CLI 直接纯英文输出不就没这事了吗😂
不过无所谓了,都有 UI 了就不考虑看 CLI 了🙄
from peerbanhelper.
实验性在 v2.7 中进行了修复,效果未知。
from peerbanhelper.
实验性在 v2.7 中进行了修复,效果未知。
不知道是否跟系统对非 Unicode 程序启用了 UTF-8 支持的原因有关,实测依旧。
其实这就是字体问题,由于启用全局 UTF-8 编码后,cmd 默认用的是 Consolas
字体,该字体并不支持中文。建议尝试改用 GBK 编码来让系统在默认状态下使用中文字体来确保中文能正常显示。
from peerbanhelper.
Related Issues (20)
- [样本记录] 123 云盘离线下载 HOT 1
- [BUG][WebUI] 被封禁频率最高的前50个IP地址显示异常 HOT 4
- compose文件是不是應該這樣寫 HOT 2
- Native image can't run on alpine HOT 2
- [BUG] Transmission 更改 `rpc-url` 设置后无法正常连接
- 写了个多拨检测模块,但是持久化不太会写,请问能否接手? HOT 2
- [Dev Preview] The new WebUI
- 封禁列表持久化 HOT 2
- [社区公告] 计划移除 Native-Image 二进制可执行文件支持 HOT 11
- [开发预览] Windows / Linux 跨平台 GUI
- 建议保持 Releases 文件名
- 伪造进度的没有被屏蔽 HOT 2
- v3.3.7 树莓派4B无法连接到127.0.0.1:9898 HOT 6
- Ban Peers and Unban Peers do not match
- 似乎不能正常屏蔽 HOT 3
- [开发预览] GeoIP 库与 GUI 增强
- 托盘隐藏功能请求 HOT 3
- 考虑加入禁用在启动时强制检测geoip更新的配置项,或者延长超时时间 HOT 1
- 从不支持 BTN 的旧版本直接升级镜像到最新版本会因为配置文件中缺少 BTN 相关配置而启动失败 HOT 1
- Transmission 无法识别 PBH 生成的 Transmission BlockList 规则中的 IPV6 地址 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peerbanhelper.