Saturday, October 5, 2024

keyboard – What is the font on the Enter Sources icons?

I used this imagemagicscript to generate icns on macOS

#!/bin/bash

# Set the output PNG file
output_base_name="icon"
output_icon="${output_base_name}_64x64.png"

# Picture dimension and padding values
image_width=64
image_height=64
horizontal_padding=1
vertical_padding=1
corner_radius=4

# Textual content settings
textual content="BŁ"
text_vertical_padding=12
font_size=$((image_height - 2 * vertical_padding - 2 * text_vertical_padding))  # Alter the font dimension primarily based in your choice

# Create a clear background
convert -size ${image_width}x${image_height} xc:none -alpha clear background.png

# Calculate coordinates for rounded rectangle
end_x=$((image_width - horizontal_padding))
end_y=$((image_height - vertical_padding))

# Draw a rounded-corner white rectangle with padding
convert background.png -fill white -draw "roundrectangle ${horizontal_padding},${vertical_padding} ${end_x},${end_y} ${corner_radius},${corner_radius}" rectangle.png

# Add textual content in the course of the rectangle
convert background.png -background none -fill black -gravity middle -font '.SF-Compact-Semibold-G2' -pointsize ${font_size} -annotate +2+0 "${textual content}" textual content.png

# Composite the textual content on the rounded rectangle
composite -gravity middle -compose distinction rectangle.png textual content.png "$output_icon"

# Cleanup short-term information
rm background.png rectangle.png textual content.png

output_icon_32="${output_base_name}_32x32.png"
convert "$output_icon" -resize 32x32 "$output_icon_32"

iconset_dir="Belarusian_Latin.iconset"
mkdir "$iconset_dir"
cp "$output_icon" "$output_icon_32" "$iconset_dir/"

iconutil -c icns "$iconset_dir" -o 'Belarusian (Latin).icns' 
rm -rf ${output_base_name}_*.png "$iconset_dir"

Sadly I wasn’t in a position to create rectangle form the identical dimension as a system one

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles