Commit graph

29 commits

Author SHA1 Message Date
Daniel Eklöf
a3f2e2220a
generate-alt-random: 50% chance of overwriting the last sixel 2021-03-11 17:33:00 +01:00
Daniel Eklöf
4a86cd7475
generate-alt-random: emit sixels on the alt screen 2021-03-11 17:32:59 +01:00
Daniel Eklöf
f8e51fcb17
generate-alt-random: emit multiple sixel bands
This ensures we’re getting the ‘$’ command PGO:d
2021-03-11 17:32:59 +01:00
Daniel Eklöf
eee216f5fe
generate-alt-random: sixel: pan/pad must not be 0 2021-03-11 17:32:59 +01:00
Daniel Eklöf
add30a38f3
scripts: generate-alt-random: sixel: emit DECGRI - Repeat Character 2021-03-11 17:32:56 +01:00
Daniel Eklöf
e4ae5a7586
generate-alt-random: ioctl(TIOCGWINSZ) may fail in run inside a container
This _should_ only happen when we’re doing a partial PGO build, since
then the script is run in the parent terminal. In this case, the user
is expected to use --rows/--cols anyway.
2020-12-21 13:40:53 +01:00
Daniel Eklöf
e9dea5bb9d
generate-alt-random: override detected width/height when --cols/--rows have been used
This ensures we have a valid width and height, that matches what the
PGO helper binary expects.
2020-12-20 15:36:07 +01:00
Daniel Eklöf
21cb4671a4
generate-alt-random: fix “new style” cube escape
It’s “38:5:<idx>”, not “38:2:5:<idx>”.
2020-12-20 15:27:27 +01:00
sterni
050da302b8 generate-alt-random-writes: use python random, allow setting a seed
Using Python's own PRNG should make the code cleaner and allow for
reproducible stimulus files if that is desired via setting --seed (at
least for the same versions of the script, changing the kind and/or
order of the random calls will of course impact the output in the
future).

I did the following substitutions:

* rand.read(1)[0] % n and struct.unpack('@H', rand.read(2))[0] % n →
  random.randrange(n)
* rand.read(1)[0] → random.randrange(256)
* rand.read(n) → [random.randrange(256) for _ in range(n)]
  (better alternative would have been random.randbytes(n), but is only
  available for Python >= 3.9, switching to this in the future will
  impact output)
* list[rand.read(1) % len(list)] → random.choice(list)
2020-12-20 14:52:27 +01:00
Daniel Eklöf
d2f0b82bda
scripts: generate-alt-random-writes: add --sixel
When --sixel is specified, we generate random sixel images in the
‘normal’ screen, after exiting the alt screen.
2020-11-24 21:31:34 +01:00
Daniel Eklöf
96db338262
scripts: generate-alt-random-writes: add unicode and multi-column chars 2020-11-22 19:29:43 +01:00
Daniel Eklöf
b437013a3b
scripts: generate-alt-random-writes: add support for bold/italic/underline 2020-11-22 19:29:43 +01:00
Daniel Eklöf
60c8637231
scripts: generate-alt-random-writes: don’t always reset all attributes 2020-11-22 19:29:43 +01:00
Daniel Eklöf
1e1fb157dc
scripts: generate-alt-random-writes: mix \e[S with \n 2020-11-22 19:29:43 +01:00
Daniel Eklöf
c679da7316
scripts: generate-alt-random-writes: add support for emitting 256-indexed colors 2020-11-22 19:29:42 +01:00
Daniel Eklöf
5aa97189df
scripts: generate-alt-random-writes: mix new/old-style RGB escapes 2020-11-22 19:29:42 +01:00
Daniel Eklöf
66527b39b1
scripts: generate-alt-random-writes: add command line arguments for cols/rows 2020-11-22 19:29:42 +01:00
Daniel Eklöf
2639e7d2e2
scripts: generate-alt-random-writes: don’t re-use ‘count’ variable 2020-11-22 19:28:54 +01:00
Daniel Eklöf
a4b1c09d58
scripts: benchmarking utility script 2020-05-31 12:43:03 +02:00
Daniel Eklöf
b1b32152c1
unicode-precompose: use fcft's precompose functionality
This allows us more options when determining whether to use a
pre-composed character or not:

We now only use the pre-composed character if it's from the primary
font, or if at least one of the base or combining characters are from
a fallback font.

I.e. use glyphs from the primary font if possible. But, if one or more
of the decomposed glyphs are from a fallback font, use the
pre-composed character anyway.
2020-05-09 12:06:11 +02:00
Daniel Eklöf
a24a3520c7
script: generate-unicode-precompose: generate a complete header file 2020-05-02 18:25:15 +02:00
Daniel Eklöf
d945b68b73
unicode-combine: remove utf8proc dependency
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.

We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.

That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
2020-05-02 17:29:00 +02:00
Daniel Eklöf
3bc6db1e8c
scripts/generate-alt-random-writes: use TIOCGWINSZ instead of shutil 2020-03-08 13:52:59 +01:00
Daniel Eklöf
5001dd844e
script: generate-alt-random: reduce output size 2019-12-19 20:01:52 +01:00
Daniel Eklöf
ce4d2a085a
generate-alt-random-writes: reduce output size 2019-09-20 22:39:09 +02:00
Daniel Eklöf
77f6c126f5
generate-alt-random-writes: generate streaks of characters 2019-08-30 21:37:51 +02:00
Daniel Eklöf
6f0e92627e
generate-alt-random-writes: reset SGR and scroll region at the end 2019-08-23 21:06:33 +02:00
Daniel Eklöf
f0663c951e
generate-alt-random-writes: generate color, scroll and scroll region sequences 2019-08-22 17:31:13 +02:00
Daniel Eklöf
832f6520d0
generate-alt-random-writes: script to generate payload for profiling 2019-08-21 20:01:17 +02:00