private static List<BidiRun> createFragments(@NotNull EditorView view, @NotNull CharSequence text,
                                                @JdkConstants.FontStyle int fontStyle) {
    if (text.isEmpty()) return Collections.emptyList();

    FontFallbackIterator ffi = new FontFallbackIterator()
      .setPreferredFonts(view.getEditor().getColorsScheme().getFontPreferences())
      .setFontStyle(fontStyle)
      .setFontRenderContext(view.getFontRenderContext());

    char[] chars = CharArrayUtil.fromSequence(text);
    List<BidiRun> runs = createRuns(view, chars, -1);
    for (BidiRun run : runs) {
      for (Chunk chunk : run.getChunks(text, 0)) {
        chunk.fragments = new ArrayList<>();
        addFragments(view, run, chunk, chars, chunk.startOffset, chunk.endOffset, null, false, ffi);
      }
    }
    return runs;
  }
private static List<BidiRun> createFragments(@NotNull EditorView view, @NotNull CharSequence text,
                                                @JdkConstants.FontStyle int fontStyle)