空影

空影

摄影、后期处理、图像合成的经验分享。
tg_channel

Foliate Reader Installation

Foliate.svg

The e-books discussed in this article do not include the PDF format.

Prologue#

Last week, due to a computer DNS failure, I tried many methods but couldn't fix it. In the end, I had to resort to the ultimate reinstallation technique💥. After installing the new system (Windows 11 22H2), choosing a reader on Windows became a headache again. For me, paid options are out of the question🐶, but the few free ones either have clunky operations or ugly interfaces. This is not to say that my requirements are too high, but because I have previously used some very user-friendly readers.

Since the second year of junior high school until now, my fourth year of college, I have used many devices and experienced various systems. Below, I will list these systems and the readers on them in chronological order:

Each reader has its own characteristics. If you are interested, you can click on the links to search for their features. I won't go into detail here, but they all have one thing in common—they are imperfect. For example, although Calibre supports all platforms (except Android) and all formats, its reader is too ugly and only suitable for organizing books. Foliate and KOReader, on the other hand, are aesthetically pleasing but only support Linux platforms. The slightly better ones on the Windows platform require payment (such as Neat Reader), and the free ones have strange operations (the sidebars in Koodo Reader keep jumping around, which is annoying). Some readers also have strange bugs (Freda adds a space between Chinese characters when copying). The formats they support are also similar, and I won't comment on them here. In my opinion, a good reader should prioritize its interface and operation, followed by its features. If I were to rank readers regardless of platform, it would be as follows:

Foliate > Native Kindle Reader > Moon+ Reader > KOReader > iBook Reader

The reason why I put Foliate in the first place is because it has many advantages. First, it supports a wide range of formats and is compatible with almost all e-book formats. Its interface is beautiful and user-friendly. Second, it has a very attractive feature: note export and backup. This feature alone is enough to outperform all other readers. For more detailed features, you can refer to the official website or this article on Linux China. However, because it does not support the Windows platform, many people are not familiar with it. I also checked the issues in the software's GitHub repository, and the developers do not intend to support the Windows platform. It seems that one of the core architecture tools of this software does not support Windows, and it would be very troublesome to reprogram the entire software to make it work. But the power of the masses is great. I found someone in the comments section who installed Foliate in a different way and it works perfectly on Windows. That's what this article is about—installing Foliate on Windows.

Installation#

Principle#

By installing a Linux subsystem and leveraging the features of WSL2, you can easily open the software and store books.

Installing the WSL Subsystem#

Prerequisites: You must be running Windows 10 version 2004 or higher (build 19041 or higher) or Windows 11.

  1. Open "Control Panel" and click on "Programs and Features". Alternatively, you can open the command prompt and use the following command:

    appwiz.cpl
    
  2. Check the following two options:

    • Hyper-V
    • Windows Subsystem for Linux
  3. Click OK and wait for the system to install, then restart your computer.

  4. Install WSL Ubuntu (WSL2 should be the default option. If you are only reading, you don't need to worry about which Linux system to use. I tested several of them and found that Ubuntu has the highest support and runs the smoothest.) Enter this command in an administrator PowerShell or Windows Command Prompt. You can refer to this article for other WSL commands.

    wsl --install
    
  5. Restart your computer to install and run the Windows Subsystem for Linux (WSL).

Subsystem Initialization#

Normally, you will see a Ubuntu logo in the start menu. Click on it to enter the Ubuntu terminal. Set your username and password according to the prompts. After initialization, update the system with sudo apt update && sudo apt upgrade.

By default, the subsystem is installed on the C drive. After initialization, you can use the application migration feature in "Settings" > "Apps" > "Installed Apps" > "Ubuntu" to move it to another drive.

Localization and Fonts#

Next, modify the /etc/locale.gen file to set the locales that can be used in the system to Chinese (remove the comment symbol "#" in front of the corresponding items):

sudo vim /etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8

Then, modify the configuration file /etc/default/locale and comment out or delete the original content:

sudo vim /etc/default/locale
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
LC_NUMERIC="zh_CN"
LC_TIME="zh_CN"
LC_MONETARY="zh_CN"
LC_PAPER="zh_CN"
LC_NAME="zh_CN"
LC_ADDRESS="zh_CN"
LC_TELEPHONE="zh_CN"
LC_MEASUREMENT="zh_CN"
LC_IDENTIFICATION="zh_CN"
LC_ALL="zh_CN.UTF-8"

Then, execute the locale-gen command to use these locales in the system. It is recommended to restart the terminal.

sudo locale-gen
    Generating locales (this might take a while)...
      en_SG.UTF-8... done
      zh_CN.UTF-8... done
    Generation complete.

You can use the locale command to check the current locale. You can also use the locale -a command to check the available locales.

sion@sion:~$ locale
    LANG=zh_CN.UTF-8
    LANGUAGE=
    LC_CTYPE="zh_CN.UTF-8"
    LC_NUMERIC="zh_CN.UTF-8"
    LC_TIME="zh_CN.UTF-8"
    LC_COLLATE="zh_CN.UTF-8"
    LC_MONETARY="zh_CN.UTF-8"
    LC_MESSAGES="zh_CN.UTF-8"
    LC_PAPER="zh_CN.UTF-8"
    LC_NAME="zh_CN.UTF-8"
    LC_ADDRESS="zh_CN.UTF-8"
    LC_TELEPHONE="zh_CN.UTF-8"
    LC_MEASUREMENT="zh_CN.UTF-8"
    LC_IDENTIFICATION="zh_CN.UTF-8"
    LC_ALL=

In addition to setting the locale, you also need to install Chinese fonts.

sudo apt-get install ttf-wqy-microhei 

Alternatively, you can copy the fonts to /usr/share/fonts and install them with the following commands:

The file directory in WSL2 is very simple: \\wsl.localhost is the directory for WSL, and the installed subsystem is located under it. It is just like operating files in a disk, so you can directly manipulate them. For information on installing fonts in the Ubuntu system, you can refer to this article, which provides detailed instructions👍.

sudo apt-get install ttf-mscorefonts-installer fontconfig
sudo mkfontscale && mkfontdir && fc-cache -fv

Installing Foliate#

After configuring all of the above, you should be able to install any Linux software and run it in GUI mode.

  1. Update the system.

    sudo apt update && sudo apt upgrade
    
  2. Install Foliate via PPA.

    sudo add-apt-repository ppa:apandada1/foliate
    sudo apt update
    sudo apt install foliate
    
  3. Open Foliate directly from the start menu.
    Display

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.