Jump to content
dfay

Font workflow - ideas

Recommended Posts

I'm wondering if it would be possible in Alfred 4 to write a workflow that would call a list filter or script filter which would display the text selection in various fonts, with an action to paste the reformatted text.

 

All of this is straightforward except changing the font.  I looked briefly at the arg/var object but it doesn't allow rtf transformations at this point.  I'm not really up for writing the raw rtf code to do this but wondering if there's a simpler way....

Share this post


Link to post

How are you displaying the font samples? In a Large Type? If so, you can use a JSON Config to change the font used.

Share this post


Link to post

That could work.  I'd really like to just override the fonts in Alfred's window, like this but with fonts:

 

 

Share this post


Link to post
52 minutes ago, dfay said:

I'm not really up for writing the raw rtf code to do this

 

Write it in HTML and use textutil (builtin) to do it. That’s the method I’m using in MarkdownTransform.

 

This is a fun idea that might complement a Workflow I’ve been thinking about to manage fonts. In my case I’m focused on downloading/installation and removal.

Share this post


Link to post

I think I'm out of the loop here. You can use RTF in Alfred's results? And if so, how?

 

4 hours ago, vitor said:

Write it in HTML and use textutil (builtin)

 

This works pretty well. It sucks for inline text (as opposed to whole paragraphs), but it is a lot easier than messing around with raw RTF (which is how I had to do it in Zothero).

Share this post


Link to post
2 minutes ago, deanishe said:

I think I'm out of the loop here. You can use RTF in Alfred's results? And if so, how?

 

I don’t think you can, and I don’t see it happening anytime soon (or ever). I’d sooner expect an extra panel to display arbitrary info (à la Spotlight) than being able to change the text style on a per-line-result basis.

Share this post


Link to post
1 minute ago, vitor said:

I don’t think you can, and I don’t see it happening anytime soon (or ever).

 

Right. This is also what I've always assumed.

 

I think I misunderstood what @dfay is trying to do. I thought he wanted to preview the fonts in Alfred, not just output rich text formatted with that font.

 

Now that I've had a think about it, the problem I had with ZotHero that textutil always added a font face (I just wanted inline styles like bold and italics), so it was no good for pasting into existing text. That's not a problem here, though, seeing as changing the font face is the whole idea.

Share this post


Link to post
1 hour ago, deanishe said:

I think I misunderstood what @dfay is trying to do.

 

I don’t think so.

 

1 hour ago, deanishe said:

I thought he wanted to preview the fonts in Alfred, not just output rich text formatted with that font.

 

Pretty sure that’s it.

Share this post


Link to post

Yes, that's what I was hoping.  I looked at the snippet viewer and the snippet keyword results with an RTF snippet, and neither shows the formatting.

 

On 6/7/2019 at 10:34 AM, deanishe said:

In a Large Type? If so, you can use a JSON Config to change the font used.

 

Hmm I've tried this at your suggestion but am guessing in the dark as to the JSON to use - is it documented somewhere?

Share this post


Link to post

You right-click on the element you want to configure and do Copy Configuration.

 

That’s all I know about it, tbh.

Share this post


Link to post
Posted (edited)

Well that lets me get the existing config

 

{
  "alfredworkflow" : {
    "config" : {
      "textcolor" : "",
      "backgroundcolor" : "",
      "largetypetext" : "{query}",
      "alignment" : 0,
      "fadespeed" : 50,
      "font" : "",
      "fillmode" : 1
    }
  }
}

But adding a JSON Config object before the Large Type object with a different value for font doesn't affect the result.

 

@Andrew is this expected behaviour?

Edited by dfay

Share this post


Link to post

@dfay oops no, I didn't implement the json config interface for the updated part of LargeType for v4. I'll get that fixed up for the next build.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...