Animated movie, kid gets book from father, has words which can make you a portal to a specific different dimension, and words to control a creature

A movie in which a young boy goes to visit his psychotic father in prison and then later gets a book from his mother who says his father wanted him to have it. Later he reads it and says a few words from the book, and then a portal opens up in the ground to another dimension, he wakes up in a very cold place, and then soon meets a creature, which he befriends, and can control with the words from the book,

Don’t remember much of the rest of plot, but yeah, can somebody help?

howard lovecraft and the frozen kingdom