This question is complicated; it could be interpreted in multiple ways.
You asked how to make programs/libraries which either...
- Do the lowest-level graphics operations possible on PC-style hardware with VGA-compatible graphics?
- Do the lowest-level graphics operations while still be practically usable on today's systems?
- Implements high-level drawing primitives on memory buffer, regardless of the actual graphics display mechanism in-use?
I will not say "don't reinvent the wheel", because auto engineers would have to learn about how wheel are engineered and manufactured at some point. And if you're an auto engineer that would like to improve the wheel, then you got to reinvent the wheel, or at least parts of it.
At first glance, your question might read as interpretation #1 or #2; but I have re-read that again, and finally figured that
you probably meant interpretation #3 (the drawing primitives).
In this case, you might want to look for college textbooks, course notes, or tutorials along that line which taught computer engineers (and probably software engineers) how computer graphics work; and you just go read the algorithm parts, and skip the hardware stuff. I hadn't dabbed too much in the subject when I was in formal education, so I cannot suggest a specific book, sorry.
This is one of such tutorials that came up in my web search.
But if you have specific drawing primitives you would like to learn about, there are certain web search keywords you could use as well: usually "algorithm", "draw" followed by the graphics primitive you would like to learn. For example (DuckDuckGo):
For drawing text... that one is another complicated subject. The most primitive way of drawing text is just that you draw an image of each letter (a la "bitmap font") next to each other; which is still used in certain applications, like 2D videogames. Doing text rendering like modern graphics toolkits did is not what a beginner in computer graphics should even try to pry on. (Hint: it involves drawing solid-fill bezier curves, subpixel dithering tricks, live-interpretation of font-provided bytecode, and typesetting)