Jump to content

Odd text wrapping in Large Type output (bug?)


luckman212

Recommended Posts

  • macOS 11.2
  • Alfred 4.3.1.1214

 

I have some workflows that dump columnar text into LargeType. For some reason, the wrapping gets crazy sometimes. Long lines, especially ones containing many spaces end up with soft line breaks all over the place. I think pictures are worth 1000 words here, so here are a few as well as a workflow that you can download to replicate these:

 

LargeType Odd Wrapping.alfredworkflow

 

  • The workflow trigger is keyword "jibber"
  • It generates 10 lines of random text, in 2 columns
  • It accepts an optional parameter in the format #words:separator. e.g "5:="
  • Default is 8 words, with space as the delimiter
  • The first column contains the words, the 2nd column is the md5 hash of those words
  • Output is passed on to LargeType (and copied to the clipboard)

 

image.png.5a1090a44984bc35f9081a7cd240b4db.png

 

This produces the following output:

image.thumb.png.96c96818fc4f4d4c739c176f5a8e9211.png

 

Since the text has also been copied to the clipboard, you can paste into Sublime Text etc to verify that is was correctly formatted prior to being displayed by Alfred.

image.thumb.png.cb2b6f0614a0745a09d701fcf181f718.png

 

Using 4 words or less produces clean output for some reason:

 

image.png.2a9ae6f022ba18c90305a011ae70f5ab.png

 

pb-axUeBUu5V8.png

 

Using 5+ words (`jibber 5`) triggers the wrapping problem for me:

 

image.thumb.png.cfd5aa8a1256c5bfe4930abc1f55c89e.png

 

Using `_` as a separator to join the words (`jibber 8:_`) reduces the problem somewhat (with the exception of the FIRST line for some reason)

 

image.png.0890dd3e6b61f5bdc3ac77e24fc15730.png

 

image.thumb.png.d6b32405f4869f36c7d462511ec31fc7.png

 

These are my general LargeType feature settings (font=SF Mono however I have tried other proportional as well as monospace fonts and while the sizing changes a bit, overall the bug is still reproducible regardless of font)

image.png.54ec6f25c2c3c42416d99a43885a061a.png

 

@Andrew hoping you can have a look. Thank you!

 

 

Edited by luckman212
Link to comment
Share on other sites

  • 2 weeks later...

By Jove you've done it!

 

image.thumb.png.b97bdac3bacf4d9de99419c2fd17b1f1.png

 

Thanks again for this 🎉

 

P.S. to anyone else who happened to download the test workflow above, I noticed a bug in it this morning- $RANDOM is 16-bit only (0-32767) so the jibberish output only contains words beginning with the letters {a,b,c}. Pretty boring. Newer versions of Bash support $SRANDOM which is 32-bit, so changing the shebang to #!/usr/local/bin/bash and RANDOM to SRANDOM will "fix" it.

 

Also, swapping in gnu-sed for the built in macOS sed speeds up the loop by a factor of 2 for me. Here's an updated version in case anyone cares:

LargeType Odd Wrapping_v0.0.2.alfredworkflow

 

(use brew install bash gsed to satisfy the requirements...)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...