Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(term size): add max-font-size mode 新增最大字型大小模式 #81

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

feat(term size): add max-font-size mode 新增最大字型大小模式 #81

wants to merge 1 commit into from

Conversation

IepIweidieng
Copy link
Contributor

@IepIweidieng IepIweidieng commented Apr 26, 2021

The max-font-size mode behaviors like the fixed-font-size mode in that a basic font size can be specified by the user.
max-font-size(最大字型大小)模式很類似於 fixed-font-size(固定字型大小)模式,它們的基本字型大小都可由使用者指定。

However, when the window is too narrow or too short, fixed-font-size just lets the terminal screen overflow the window, while max-font-size shrinks the font to keep the screen inside the window.
但,當視窗過窄或過矮,fixed-font-size(固定字型大小)會直接讓終端機畫面超出視窗,而 max-font-size(最大字型大小)會縮小字體讓畫面維持在視窗內。

This feature should benefit users who use PttChrome on a relatively small screen (e.g., mobile/tablet users) and want to maximize the use of the limited space of their screen for reading without manually tweaking the terminal size in the fixed-term-size mode.
這個功能應有利於在相對小的螢幕(例如手機或平板電腦)上使用 PttChrome,且想儘量利用閱讀時有限的螢幕空間,又不想手動調整 fixed-term-size(固定終端機大小)中的終端機寬高設定的使用者。

Video for demonstration 展示影片:

DreamBBS-v3.0.2021-04-27.pttchrome.max-font-size.resizing.mp4

Note: After the recording of the video, the options for specifying the minimum height and width of the terminal screen size for max-font-size were dropped for the convenience of user. The minimum terminal screen size is hardcoded as 80 cols x 24 rows.
注意:在錄完該影片後,爲了方便使用者,移除了 max-font-size(最大字型大小)中用來指定終端機的最小高度與寬度的選項。終端機的最小寬高寫死成 80 縱列 × 24 橫行。

The max-font-size mode behaviors like the fixed-font-size mode
in that a basic font size can be specified by the user.

However, when the window is too narrow or too short,
fixed-font-size just lets the terminal screen overflow the window,
while max-font-size shrinks the font to keep the screen inside the window.

This feature should benefit users
who use PttChrome on a relatively small screen (e.g., mobile/tablet users)
and want to maximize the use of the limited space of their screen for reading
without manually tweaking the terminal size in the fixed-term-size mode.

* src/components/ContextMenu/PrefModal.js PrefModal
    * Add "max-font-size" mode as a new termSizeMode
    * Add "options_maxFontSize" to the "termSizeMode" select list

* src/js/en_US_messages.js & src/js/zh_TW_messages.js
    * Add translated messages for "options_maxFontSize" options

* src/js/pttchrome.js App.prototype.onValuesPrefChange()
    * Add fontsize-handling logic to the new termSizeMode case 'max-font-size'

* src/js/term_view.js
    * Add TermView.prototype.calcFontSizeFromTerm()
      to obtain the maximum allowed font size for a given terminal size
holishing added a commit to ccns/PttChrome that referenced this pull request May 13, 2021
explanation: robertabcd#81

feat(term size): add max-font-size mode

The max-font-size mode behaviors like the fixed-font-size mode in that a basic font size can be specified by the user.

However, when the window is too narrow or too short, fixed-font-size just lets the terminal screen overflow the window, while max-font-size shrinks the font to keep the screen inside the window.

This feature should benefit users who use PttChrome on a relatively small screen (e.g., mobile/tablet users) and want to maximize the use of the limited space of their screen for reading without manually tweaking the terminal size in the fixed-term-size mode.

Video for demonstration:
https://user-images.githubusercontent.com/37586669/116145093-6c677680-a70f-11eb-9983-7eadda00b09b.mp4

Note: After the recording of the video, the options for specifying the minimum height and width of the terminal screen size for max-font-size were dropped for the convenience of user. The minimum terminal screen size is hardcoded as 80 cols x 24 rows.
@IepIweidieng IepIweidieng changed the title feat(term size): add max-font-size mode feat(term size): add max-font-size mode 新增最大字型大小模式 Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant