# Getting the length of lines in edit view?

**URL:** <https://forum.glyphsapp.com/t/getting-the-length-of-lines-in-edit-view/35287>\
**Category:** Scripting\
**Created:** [October 2, 2025, 2:29pm UTC](https://forum.glyphsapp.com/t/getting-the-length-of-lines-in-edit-view/35287 "2025-10-02T14:29:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkutilek](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/jkutilek/32/29173_2.png) [@jkutilek](https://forum.glyphsapp.com/u/jkutilek)\
**Post date:** [October 2, 2025, 2:29pm UTC](https://forum.glyphsapp.com/t/getting-the-length-of-lines-in-edit-view/35287/1 "2025-10-02T14:29:43Z")

</div>

Is there an easy way to ask Glyphs for the width of each line of the edit view? Or do I have to add the glyph widths (and kerning) up myself?

I have to compare different versions of glyphs and would like to show the relative difference in line lengths, as shown here by the red number:

 ![Bildschirmfoto 2025-10-02 um 16.24.22](https://forum.glyphsapp.com/uploads/default/original/3X/9/7/9709a5e83e0b4b6dabe8af59de9fe869d5cdc156.png)

---

<div class="post-metadata">

**Author:** ![GeorgSeifert](https://forum.glyphsapp.com/user_avatar/forum.glyphsapp.com/georgseifert/32/259_2.png) [@GeorgSeifert](https://forum.glyphsapp.com/u/GeorgSeifert)\
**Post date:** [October 2, 2025, 2:59pm UTC](https://forum.glyphsapp.com/t/getting-the-length-of-lines-in-edit-view/35287/2 "2025-10-02T14:59:51Z")

</div>

The GlyphsEditView has `cachedPositionAtIndex:`. You still need to iterate all layers and add up per line, but you don’t need to deal with all the different positioning rules. There should be one more position than layers for the pos at the end.
