l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
259 stars 31 forks source link

Font size during review #65

Closed lcabrini closed 1 year ago

lcabrini commented 3 years ago

It would be nice to be able to have a larger font size only during review sessions. I used played around with org-drill some time back and had keybindings set up to increase font scaling(?) during review. However, it would be nice if this could be automated so that it increases during review and goes back to normal after.

l3kn commented 3 years ago

org-fc has two hooks that are run before and after the review session, org-fc-before-review-hook and org-fc-after-review-hook.

In the before-review-hook, you could save the old font size and set a new larger one, then use the after-review-hook to reset it.

lcabrini commented 3 years ago

Great! I'll look into those hooks. Thanks! (And sorry that I fired of issues without RTFC first).

l3kn commented 3 years ago

Don't worry about not having read the code, that shoudn't be neccessary for a feature like this (that's what the hook system is for).

Looks like I wrote a bit of documentation for it at https://www.leonrische.me/fc/customizing_org-fc.html but it doesn't really show how to use the hooks.

Let me know if you come up with an implementation, then I can add it to the page as an example.

cashpw commented 1 year ago

I'm using doom emacs and have the following to handle font size during review:

(use-package! org-fc
  ...
  :config
  ...
  (defun cashweaver/org-fc--increase-font-size()
    (doom/increase-font-size 2))
  (add-hook! 'org-fc-before-setup-hook
             #'cashweaver/org-fc--increase-font-size)
  (add-hook! 'org-fc-after-review-hook
             #'doom/reset-font-size)