Althoughy not officially supported; formatting codes CAN be used even in vanilla java clients. (pre 1.14, & post 1.18). This feature was unintentionally added back in with the 1.18.1 update (it seems, as I can't get it to work on versions between 1.14 and 1.18.1), however only book&quills can be formatted from within the game.
The procedure to add formatting in java edition is almost the same as in bedrock, however the section character § must be copied by itself and pasted with Ctrl+V, then type a format character, you can no longer copy a formatting code such as §6 or §k.
By copying the section character only, you can indeed add formatting to Book & quill from within the game in java too. The text can even be formatted by moving the cursor/caret within the book and adding formatting with Ctrl+V and a format character.
PS: Before this post gets deleted for "wrongful information": Try it yourself, and see that it actually does work in java² as well as in bedrock³
² The formatting character(s) will be invisible, but the formatting will show, if done correctly
³ The formatting character(s) will be visible until you sign the book
Althoughy not officially supported; formatting codes CAN be used even in vanilla java clients. (pre 1.14, & post 1.18). This feature was unintentionally added back in with the 1.18.1 update (it seems, as I can't get it to work on versions between 1.14 and 1.18.1), however only book&quills can be formatted from within the game.
The procedure to add formatting in java edition is almost the same as in bedrock, however the section character § must be copied by itself and pasted with Ctrl+V, then type a format character, you can no longer copy a formatting code such as §6 or §k.
By copying the section character only, you can indeed add formatting to Book & quill from within the game in java too. The text can even be formatted by moving the cursor/caret within the book and adding formatting with Ctrl+V and a format character.
PS: Before this post gets deleted for "wrongful information": Try it yourself, and see that it actually does work in java² as well as in bedrock³
² The formatting character(s) will be invisible, but the formatting will show, if done correctly ³ The formatting character(s) will be visible until you sign the book