The underground comic writer Harvey Pekar didn't really do happy, but he did truth and humour in spades, which is why American Splendor, a 2002 film about Pekar (in which he also appears), got under my skin in a big way. "If you're the kind of person looking for romance or escapism or some fantasy figure to save the day," warns his rasping narration at the start, "guess what? You got the wrong movie." Sometimes, a little cinematic holiday from the gloss and fantasy of Hollywood is just what the doctor ordered.

Pekar, a downtrodden hospital file clerk, chronicled the intricacies of his glum life in depressed Cleveland, Ohio, in his ironically named American Splendor comic books. He wrote the words, and artists such as Robert Crumb did the pictures. Pekar is often referred to as the Mark Twain of comic books, and an anthology of his work won the American Book award in 1987. Despite this – and the fact he moonlighted as a jazz and book critic, and regularly appeared as a comically grouchy guest on the Letterman show (for the "dough") after his cult, hipster, anti-hero status got him noticed by producers at NBC – Pekar never felt in a position to quit his day job.

American Splendor, the movie, begins with Pekar (played by Paul Giamatti) losing his voice to a stress-related vocal chord nodule, on account of his second wife ditching him and his "plebian lifestyle". Not long after, Pekar and Crumb meet at a yard sale while examining old jazz records. (Pekar, who is unashamedly tight, is wondering whether he could talk down the price of a record from a quarter because it has a crack in the laminate.) Then we witness Pekar's rise to (relative) fame and his getting together with wife number three, Joyce Brabner, his neurotic match. Eventually, he is diagnosed with cancer (sounds fun, huh?) and the only thing that can get the couple through it is to co-write a (celebrated) graphic novel, Our Cancer Year, about the experience. But there's plenty of joy to be found in the film: the completely unromanticised human relationships, the humour, the continuous bummer that is Pekar's existence.

But what really lifts the film to the heights of poignancy is its odd mixture of documentary and drama. Most of the film is in fact dramatic (Giamatti acts out scenes from Pekar's life) but this is interspersed with asides showing the real-life protagonists chatting (somewhat awkwardly, in fact, unless they just appear stilted compared with the actors' performances) in an empty white studio. This reminder that the story is about genuine, flesh-and-blood people with human frailties adds tenderness; it makes the film feel as pathologically honest as Pekar himself. (The first thing he says to Brabner on their first date: "You might as well know, I had a vasectomy.") At one point, Giamatti and Judah Friedlander (AKA Frank from 30 Rock), who plays Toby Radloff, Pekar's self-confessed nerd colleague at the hospital, walk off the set and sit, dwarfed in the background, while the real Pekar and Radloff – the true stars – talk in the foreground.

Giamatti channels Pekar beautifully. In his voiceover, the real Pekar says the guy playing him "don't look nothing like me" – the actor is, admittedly, cuddlier-looking – but Giamatti portrays his many beefs and neuroses with sensitivity and humour, without straying into hamminess. Throughout, he maintains a graphic grimace, helping to recreate a comic-book feel. (Pekar once said of his work: "It's an autobiography written as it's happening.") And the way Giamatti captures those subtly glorious moments when Pekar cocks his head and smirks at the hilarity of his humdrum life, filing it in his writer's mind for later, is pure gold.

American Splendor is one of three films, all coming out within a year or so of each other, that made my hair stand on end. Lars von Trier's Dogville, Spike Jonze's Adaptation and Splendor (which was directed by documentary-makers Robert Pulcini and Shari Springer Berman) all have a postmodern, Brechtian thing going on, where the illusions behind film-making are undermined and dispelled. Some people think this is little more than directors sticking their heads up their behinds. But, with these three films at least, I find the extra layers make the film more affecting; they make me think more.

Harvey Pekar died last year at the age of 70. He was still married to his third wife, and on his third bout of cancer and anti-depressants. Like I said, he didn't do happy. But he did funny and truth, and so does this movie – beautifully.