From: Kevin Day Date: Sun, 12 Jun 2022 04:23:37 +0000 (-0500) Subject: Update: Add script for generating Unicode Codepoints from integers. X-Git-Tag: 0.5.10~46 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=c9211a974c220bf43f2e43e9f5c68dfdccc4cc1c;p=fll Update: Add script for generating Unicode Codepoints from integers. A simple script that I am using for generating a range of Unicode Codepoints in the format needed by the generate_unicode.sh script. The private use area is represented by multiple sets of all values within some range. These ranges are a massive list. This script generates these. The only thing I need to do is use a calculator program to convert hex to integer. These integers are then passed to the script as an inclusive range. --- diff --git a/build/scripts/generate_codepoints_from_digits.sh b/build/scripts/generate_codepoints_from_digits.sh new file mode 100644 index 0000000..1bc3410 --- /dev/null +++ b/build/scripts/generate_codepoints_from_digits.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# license: lgpl-2.1-or-later +# programmer: Kevin Day +# +# A simple script for generating code regarding unicode codepoint values. +# +# For example, given the Private Use Area range U+E000 to U+F8FF look like: +# ./generate_codepoints_from_digits.sh 57344 63743 +# + +main() { + local -i first="$1" + local -i last="$2" + + while [[ $first -le $last ]] ; do + printf "U+%04X\n" $first + + let first++ + done +} + +main "$1" "$2"