There is no ambiguity in the meaning of the first character fang.
Yang Hui's "Nine Chapters on the Mathematical Arts with Detailed Explanations" defines cheng as a general term for measuring weight, height, and length.