0

I have a strange request. I need an app to write raster text. That is, when I press the J key on my keyboard, the app must produce a raster (that is, non-editable) letter J.

I suffer from writing-related OCD and such an app or script will prevent me from editing the same text again and again. The workflow will be very close to how we produce texts with a pen and paper.

Yes, I do know I can simply type some text in Apple Pages / Microsoft Word / LibreOffice Writer, then make a screenshot of this text and then paste this screenshot back in the document. This is a different approach and sorry, I don't like it.

5
  • It won't prevent you editing, it will just make you do it a different way. Photoshop can do this, yet it can just as easily erase it again.
    – Tetsujin
    Jan 26, 2023 at 16:07
  • I know it will work because I already tried this workflow with Photoshop. The only problem with Photoshop is the same as I have described in the 3rd part of my question here. Using Photoshop, I have to rasterize the text manually instead of it will be rasterized automatically, character by character. What I ask here is app that works as I have described, not discussions about whether that app will work to solve my problem.
    – jsx97
    Jan 26, 2023 at 16:23
  • Hardware solution would be a modern typewriter with no screen or one small enough to be non-conducive to editing. Jan 26, 2023 at 16:34
  • How about console program that would let you type and prevent you from using backspace/arrows? That can be implemented easily using read/print in a shell script.
    – Nicolas Raoul
    Jan 27, 2023 at 8:47
  • @NicolasRaoul I don't think this would be convenient. My current solution is Apple Pages on Mac + Apple Pencil + iPad. This way I can add sketches, each sketch is a single paragraph of handwriiten text, automatically converted into image (I don't have OCD when I write text by hand). This approach generally works, but writing by hand takes more time and the text itself takes more page area.
    – jsx97
    Jan 28, 2023 at 1:20

1 Answer 1

0

I have a strange request.

Indeed. Very unusual. I doubt such a thing exists out of the box for download.

There seem to be ways of implementing it without turning the text into a pixel graphics. The following code provides a "normal" TextBox that does not let you remove text.

Benefit of such a solution compared to turning it into a pixel graphics is: it is still text and can be treated as such, e.g. for saving it into a text file. You can send it to someone else for further editing, which would be pretty hard if the text is a pixel graphics.

If money is not a problem, someone on https://www.fiverr.com/ with macOS background will implement it for you, maybe even with some features like saving and loading. Should be a nice and interesting 30$ task for some 15 year old script kiddie.

I never programmed C# code for macOS, but Visual Studio Code and Mono might be able to handle it. Here's the core logic:

public class NoDeleteTextBox : TextBox
{
    public NoDeleteTextBox()
    {
        ShortcutsEnabled = false;
        Multiline = true;
    }

    void RemoveSelection()
    {
        SelectionLength = 0;
        SelectionStart = Text.Length;
    }

    protected override void OnKeyDown(KeyEventArgs e)
    {
        // prevent deletion
        if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
        {
            e.SuppressKeyPress = true;
        }

        // prevent selection
        if (e.KeyCode == Keys.A && e.Modifiers == Keys.Control)
        {
            e.SuppressKeyPress = true;
            RemoveSelection();
            return;
        }

        // prevent movement
        if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || 
            e.KeyCode == Keys.Up || e.KeyCode == Keys.Down ||
            e.KeyCode == Keys.PageUp || e.KeyCode == Keys.PageDown || 
            e.KeyCode == Keys.Home || e.KeyCode == Keys.End)
        {
            e.SuppressKeyPress = true;
        }
        base.OnKeyDown(e);
    }

    protected override void OnMouseDown(MouseEventArgs e)
    {
        RemoveSelection();
    }

    protected override void OnMouseUp(MouseEventArgs e)
    {
        RemoveSelection();
    }

    protected override void OnClick(EventArgs e)
    {
        RemoveSelection();
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.