空影

空影

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

Foliate Reader Installation

Foliate.svg

This article does not include PDF format e-books.

Introduction#

Last week, due to a DNS problem with my computer, 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), I was once again faced with the headache of choosing a reader for Windows. For me, paid options are out of the question🐶, but the few free ones available are either difficult to use or have ugly interfaces. This is not to say that my requirements are too high, but rather because I have already used some very user-friendly readers before.

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

Each reader has its own unique features. 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 not perfect. For example, although Calibre supports all platforms (except Android) and all formats, its reader is not visually appealing and is only suitable for organizing books. Foliate and Koreader, on the other hand, are aesthetically pleasing but only support Linux platforms. The slightly better options on the Windows platform require payment (such as Neat Reader), and the free options have strange operations (the sidebars in koodo Reader keep jumping around, which is annoying). Some readers also have strange bugs (in Freda, there is a space between each Chinese character when copying). The formats they support are also similar, so 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 > Kindle Native 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 has a beautiful interface with user-friendly operations. 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 difficult to support it by reprogramming the entire software. But the power of the masses is great, and I found someone in the comments 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 software and store books on Windows.

Installing the WSL Subsystem#

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

  1. Open "Control Panel - Programs and Features" and click on "Turn Windows features on or off"

    appwiz.cpl
    
  2. Check the following two items:

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

  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 Ubuntu has the highest support and runs the smoothest.) Enter this command in an administrator PowerShell or Windows Command Prompt. You can view other WSL commands in this article.

    wsl --install
    
  5. Restart your computer to install all the necessary components for running the Linux-based Windows Subsystem (WSL).

Subsystem Initialization#

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

By default, this 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's best to restart the terminal after that.

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 being used, or 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 then install them with the following commands.

The file directory of WSL2 is very simple: \\wsl.localhost is the directory of WSL, and the installed subsystem is under it, just like files in a disk. You can directly operate on it. For information on installing fonts in the Ubuntu system, you can refer to this article, which explains it in detail👍.

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

Installing Foliate#

After configuring all of the above, in theory, you can 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
    Demo

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