← Back to context

Comment by aidos

1 day ago

Ha! As if anything about Notion is simple.

But yeah. It's all just objects pointing at each other. It's mostly tree structured, but not entirely. You have a Catalog of Pages that have Resources, like Fonts (that are likely to be shared by multiple pages hence, not a tree). Each Page has Contents that are a stream of drawing instructions.

This gives you a sense of what it all looks like. The contents of a page is a stack based vector drawing system. Squint a little (or stick it through an LLM) and you'll see Tf switches to Font F4 from the resources at size 14.66, Tj is placing a char at a position etc.

    2 0 obj
    <<
      /Type /Page
      /Resources <<
        /Font <<
          /F4 4 0 R
        >>
      >>
      /Contents 5 0 R
    >>
    endobj

    5 0 obj
    <<
      /Length 340
    >>
    stream
    q
    BT
    /F4 14.66 Tf
    1 0 0 -1 0 .47981739 Tm
    0 -13.2773438 Td <002B> Tj
    10.5842743 0 Td <004C> Tj
    ET
    Q...
    endstream
    endobj

I'm going to hand wave away the 100+ different types of objects. But at it's core it's a simple model.