TL;DR

Font family name (Name Id 1 in name table of the font) in a OpenType font file should not be used as the font-family property in CSS if the font is not one of regular, italic, bold, and bold italic style. Instead, the Typographic Family Name or Preferred Font Family (Name ID 16 in name table of the font) should be used if including them in CSS.

Background and Problem

Recently, I was tasked to investigate an interesting problem found in our custom font implementation. Font is something I have no prior knowledge about and this investigation really helped me learn a lot more about font and by writing it down, I hope I can help developers who may face similar problems.

Our system allows user to upload any font as long as they have the permission to use the font commercially. Recently, we realized that some of the fonts uploaded by user were not displayed correctly. More specifically the font-family attribute of these said fonts were incorrectly extracted.

As an example, an user uploaded a font called fontA-SemiBold, the extracted font-family name from the font was fontA-SemiBold whereas the correct name of for the font-family should be fontA. And in this case. The incorrect font name resulted in incorrect rendering in the front-end as the CSS rendering is suppose to have the correct font-family name.

Read more »

I've always considered myself to be an advanced computer user, but I'm not a Windows person, at least not when I'm coding. So when I got a Windows 10 laptop as a daily work machine, I'm beyond disappointed. Luckily, there's always a way around -- VirtualBox it is. The laptop I got was powerful enough that I was able to allocate 16GB of memory as well as 3 cores of the host machine to the virtual machine.

Once I had my vm setup, I always use Windows Terminal and SSH into the machine for development. One day, it occurs to me I can (and should) automate all of this.

Problem

Automatically start the selected VirtualBox virtual machine in headless mode (this can save a bit of resources), wait for the machine to boot, and then SSH into the VM using Windows Terminal with selected port forwarding on the host and virtual machine.

Read more »

Though this is technically a tech blog where I usually put my thoughts and learnings regarding technologies, I still would like to share some of my experience with taking the IELTS exam which is about a month ago.

Please note that the author is in no way affiliate with the websites and/or services mentioned below, use of these software and/or services is at the sole discretion of the reader

Why I choose to take IELTS

To be honest, my current status does not require me to take the IELTS exam. Though after some consideration, I have decided to take the exam and see if I can benefit from extra immigration points by taking the IELTS exam. My goal is reaching 8 in listening and 7 in all other sections. I made the decision to take the exam on the night of May 22nd, 2021. I took the exam on June 13th, 2021. The preparation time is around 21 days.

Read more »

This week, while setting up local project for work, I encountered some weired issue during the unit test and this has something to do with postgres and its default settings under Windows and other OS.

Problem

As an example, consider the following array: [ 'D', 'd', 'a', 'A', 'c', 'b', 'CD', 'Capacitor' ]

Sorting this in JavaScript results in case sensitive result, where upper case always come first:

1
2
>>> [ 'D', 'd', 'a', 'A', 'c', 'b', 'CD', 'Capacitor' ].sort()
[ "A", "CD", "Capacitor", "D", "a", "b", "c", "d" ]

Sorting this in Postgres SQL with default installation will yield a case insensitive sorting where upper and lower case are mixed:

1
2
3
4
5
6
7
8
9
10
11
12
SELECT regexp_split_to_table('D d a A c b CD Capacitor', ' ') ORDER BY 1;

regexp_split_to_table
-----------------------
a
A
b
c
Capacitor
CD
d
D

The goal here is to make sorting consistent, so we can either fix the Postgres side or fix the JavaScript side.

Read more »

⚠ This article requires Rooted Android phones, please follow the instructions with caution.

Background

Since Android 5, the Android system have added the capability of multi-user, the aim is most likely to make sharing devices easier between different users in the family. Later on, Google added again something called profile, this allows enterprise to manage devices their employers use. In this article, I am going to explore some other possibilities enabled by multiuser/profile functionality. More specifically I'm going to focus on the restricted user profile.

Problem to Solve

There are several problems I'm aiming to solve with the restricted profile:

  • I want to focus on things that actually matter rather than spending too much time on my phone, I would like my phone to be without any apps that can disturb or distract me when I want to focus. But I don't want to uninstall certain apps, as they are necessary in order to keep in touch with my family and friends.
  • I want to install certain apps that can track me into a separate space, a space where it is impossible for them to track me using the microphone, camera, or location.
    Read more »

Recently, I started to build an application with Go, it is a quite simple application that does something very basic and then sends an notification to a telegram bot. It's quite obvious to me this kind of application is quite suitable to run as Lambda, and that's where I decided to deploy my application to once it is working well locally. It turned out that I had to solve several issues I encountered. Here I share how I solved those issues, so you don't have to scratch your head when encounter them.

Read more »

Notes:

  • WRT1200AC (this router) contains 2 partitions
  • Flashing the firmware through the Luci interface actually flashes the new firmware to the inactive partition

Steps:

  • Download the bin file needed to upgrade the package
  • Create a list of all the installed packages on current version using opkg list-installed | cut -f 1 -d ' ' > /root/installed_packages.txt
  • Choose one of the following methods to flash:
    • Flash the file from the Luci interface
      OR
    • Download the file to the /tmp and then flash using sysupgrade /tmp/*.bin
      Read more »

Like it or not, 2020 has been a year where video conference are used a lot. For me, most of the meetings happens in Zoom. Finding the link to the meeting in the calendar and then clicking on it to join the meeting had gradually become a new norm and something I really don't like (the fact that after clicking on the Zoom link brings up your browser instead of Zoom itself, and prompting you to click again to open Zoom is really a pain). As someone who would like to automate things as much as possible, I did eventually find a solution that works for me albeit several third party tools are required.

Problem Statement: Automatically join a Zoom call for a meeting scheduled in calendar without user interaction (on MacOS X).

Prerequisite:

  • Alfred
    (Unclear if you need to be a paid user to create custom workflows, the author is a paid user)
  • zoom-calendar.alfredworkflow
    (Yep, I found this alfred workflow by chance and based my work and this blog on this workflow, it is very handy and I would really like thank the author for creating this.)
  • Automator
    (The builtin automation app in MacOS from Apple)
    Read more »

As a developer, you will sometimes face weird problems, it is important to come up with reliable and repeatable ways to solve this problems, so when such problems come up again, you would be able to find a solution easier. As for myself, one of the tools that I found most useful on Unix-like system is jq, which is a tool to process json files. Let me demonstrate how I use this tool to solve some problems I encountered during work.

Read more »
0%