Git Product home page Git Product logo

Comments (6)

Ghost-chu avatar Ghost-chu commented on May 29, 2024

遗憾的是cmd目前不能通过自动化方式修改控制台字体(至少我没找到),大部分中文版Windows应该都是开箱即用的(JVM版请根据README.md设置java参数,Native版不应该出现此问题)。

GUI和WebUI已经提上日程了,可以关注一下,后续看看能不能把控制台的内容在GUI/WebUI里面显示。

Image_1712459966349 Image_1712459968579

from peerbanhelper.

Mishasama avatar Mishasama commented on May 29, 2024

遗憾,我用的就是最新的懒人版……

据说可以通过 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.

Ghost-chu avatar Ghost-chu commented on May 29, 2024

对注册表操作远远超过了 PBH 该做的事情。作为一个小工具操作系统级注册表实在是有些越界了。
Java 确实可以调用 C++ API,但相当麻烦。我和群友测试下没有出现字体问题,因此没有计划对此单独修正(除非有更多的人出现相同问题)。可以考虑通过日志文件查看控制台日志,或者WebUI获取信息。

from peerbanhelper.

Mishasama avatar Mishasama commented on May 29, 2024

其实…… CLI 直接纯英文输出不就没这事了吗😂

不过无所谓了,都有 UI 了就不考虑看 CLI 了🙄

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 29, 2024

实验性在 v2.7 中进行了修复,效果未知。

from peerbanhelper.

Mishasama avatar Mishasama commented on May 29, 2024

实验性在 v2.7 中进行了修复,效果未知。

image
不知道是否跟系统对非 Unicode 程序启用了 UTF-8 支持的原因有关,实测依旧。

其实这就是字体问题,由于启用全局 UTF-8 编码后,cmd 默认用的是 Consolas 字体,该字体并不支持中文。建议尝试改用 GBK 编码来让系统在默认状态下使用中文字体来确保中文能正常显示。

from peerbanhelper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.