A certain faction of Melissa McCarthy’s fans won’t know what hit ‘em when they get a look at “Can You Ever Forgive Me?” I’m not suggesting they, or anyone, skip it; it’s one of my favorite pictures of the year. But McCarthy is taking on a role in a different comic (and dramatic) register than the ones that made her famous.

McCarthy knows a lot about a lot as a performer, and she’s smart enough to widen her range. One of her standout vehicles, “Spy,” took advantage of her less brash, more interior qualities, as did the earlier Bill Murray-led heartwarmer “St. Vincent.” Plainly, McCarthy was more than ready for this unlikely triumph of a biopic. The whole movie’s terrific — a little funny, a little sad, a sharp evocation of early 1990s literary Manhattan as seen from both sides of the window pane. Looking out. And looking in.

In 1991, celebrity biographer and multidirectional crank Lee Israel found herself desperate, between projects, unable to get her calls returned, alone with her cats and behind on her rent. Then she hit on a moneymaking idea that also scratched her literary itch: Across nearly two years, with the help of a barfly accomplice, she carefully forged 400-odd letters presumably written by her literary and show business idols, Noel Coward, Marlene Dietrich and Fanny Brice among them.

The scam worked until it didn’t. After the feds caught up with her, and she paid her debt to society, Israel published her confessional memoir “Can You Ever Forgive Me?” in 2008. More recently screenwriters Nicole Holofcener and Jeff Whitty began developing a script, which for a time was to co-star Julianne Moore and Chris O’Dowd. That didn’t work out, but McCarthy and Richard E. Grant did. With the guidance of director Marielle Heller, everything else did, too.

Wisely, Heller doesn’t inflate the tone or impart an overt message. But by the end, “Can You Ever Forgive Me?” has truly brought you into this woman’s life, head-space, longings and tastes, and I found the whole of it quite moving. The lovely, delicate jazz-based musical score by Nate Heller (the director’s brother) doesn’t hurt; nor does a judicious use of standards and covers from earlier times, and a more elegant, romantic Manhattan. More than once we hear from the vocalist and pianist Blossom Dearie on the soundtrack. That’s practically four stars right there.

MOVIE REVIEW

“Can You Ever Forgive Me?”

Grade: A

Starring Melissa McCarthy, Richard E. Grant and Dolly Wells. Directed by Marielle Heller.

Rated R for language including some sexual references, and brief drug use. Check listings for theaters. 1 hour, 47 minutes.

Bottom line: Funny and sad, but overall terrific