Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For most activity, you'll want to see the fonts, so Drush doesn't make a lot of sense, but I think we could at least do imports via Drush.
Comment | File | Size | Author |
---|---|---|---|
#9 | fontyourface-Initial_Drush_integration-1705216-9.patch | 4.87 KB | Drave Robber |
#7 | drush-fyf-2.png | 89.33 KB | Drave Robber |
#3 | drush-fyf.png | 126.27 KB | Drave Robber |
#2 | fontyourface-Initial_Drush_integration-1705216-2.patch | 4.29 KB | Drave Robber |
Comments
Comment #1
Drave Robber CreditAttribution: Drave Robber commentedAlso, we can have it return general status information, along the lines of:
Drush allows funny aliases. :)
Comment #2
Drave Robber CreditAttribution: Drave Robber commentedPatch attached.
Requires patch in #1823722: fontyourface_count_fonts() is broken to be applied first.
Import seems not to work for Font Squirrel as it is in current -dev, because
fontsquirrel_fontyourface_import()
does not properly return$success
;on the other hand, the new shiny batch import from #1124500: Interface for Font Squirel import only first font in family actually does not work. I need to read up on drush/batches relationship to find out why.
Comment #3
Drave Robber CreditAttribution: Drave Robber commentedHere's a glimpse of this in action:
I haven't yet figured it out how to create a new command group, but neither I'm sure if it's really necessary.
Comment #4
BarisW CreditAttribution: BarisW commentedAwesome! Thanks so much for setting this up.
Can you change the message 'Imported fonts from edge_fonts' to something like this: 'Imported 1200 fonts from Edge Fonts'?
You might also want to introduce two shortcuts for these command (fyfs & fyfi)?
What are the @i and @s shortcuts for?
Comment #5
Drave Robber CreditAttribution: Drave Robber commentedImport functions only return TRUE/FALSE, so we won't know how many new/changed were imported; we could however get a count before and after and report it like:
@s
is an alias offyf-status
; Drush seems to have no problem with such eccentric aliases.I must confess I was tempted to make it drush ffs at first, but then there would be a risk of alias conflict if someone had similar temptation. :)
I'm open to other suggestions as to what the most appropriate aliases would be.
Comment #6
BarisW CreditAttribution: BarisW commentedWhat would think of:
drush font-import / drush fyfi
drush font-status / drush fyfs
Can font-import handle arguments? Like drush font-import google_fonts?
Comment #7
Drave Robber CreditAttribution: Drave Robber commentedSure:
Comment #8
sreynen CreditAttribution: sreynen commentedI don't have a strong opinion on @s vs. fyfs as the alias. I suspect fyfs would be a little easier to remember, so I'd probably learn toward that, but it's pretty easy to get a reminder of the alias either way.
Comment #9
Drave Robber CreditAttribution: Drave Robber commentedIn fact, multiple aliases are possible - sorry for making fuss out of non-issue.
Here's a new patch. Differences to #2:
- two aliases for each command;
- found out how to create a command group;
-
fyf-status
handles a situation where there are enabled providers but no enabled fonts;- for Font Squirrel,
fyf-import
explicitly says 'not supported yet' (let's look into it when/if the batch import patch lands);-
fyf-import
reports something like 'edge_fonts now has 862 fonts (+2).' for each provider where import was successful.Comment #10
sreynen CreditAttribution: sreynen commentedCommitted. I had to do drush cc drush (clearing the drush cache) before it noticed the new file. There may be something to do in hook_update_N() to make that unnecessary, but I think anyone using this probably knows how to do that already. And if they don't, this note is here.